From 8bda82c57d71288bbd93b7082fe77994c5c713ff Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 24 Jan 2018 13:14:14 +0400 Subject: [PATCH] Test --- iguana/exchanges/LP_coins.c | 2 +- iguana/exchanges/LP_include.h | 4 ++-- iguana/exchanges/LP_nativeDEX.c | 9 ++++----- iguana/exchanges/LP_peers.c | 10 +++++----- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 07be2166b..4134936bf 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -368,7 +368,7 @@ 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); - coin->bussock = LP_coinbus(busport); + //coin->bussock = LP_coinbus(busport); if ( ctx == 0 ) ctx = bitcoin_ctx(); coin->ctx = ctx; diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 6705e8e6d..2cae0f44c 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -299,7 +299,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 numutxos,notarized,longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport; + int32_t numutxos,notarized,longestchain,firstrefht,firstscanht,lastscanht,height; uint16_t busport; uint32_t txversion,dPoWtime,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[128],smartaddr[64],userpass[1024],serverport[128],instantdex_address[64]; @@ -487,7 +487,7 @@ int64_t LP_listunspent_parseitem(struct iguana_info *coin,bits256 *txidp,int32_t 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); +//int32_t LP_coinbus(uint16_t coin_busport); int32_t LP_nanomsg_recvs(void *ctx); int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t mempool); void LP_aliceid(uint32_t tradeid,uint64_t aliceid,char *event,uint32_t requestid,uint32_t quoteid); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 8d189f74f..8cbdad5de 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -100,7 +100,7 @@ struct LP_trade *LP_trades,*LP_tradesQ; //uint32_t LP_deadman_switch; uint16_t LP_fixed_pairport,LP_publicport; uint32_t LP_lastnonce,LP_swap_endcritical,LP_swap_critical,LP_RTcount,LP_swapscount; -int32_t LP_STOP_RECEIVED,LP_numactive_LP,LP_mybussock = -1; +int32_t LP_STOP_RECEIVED,LP_numactive_LP;//,LP_mybussock = -1; int32_t LP_mypubsock = -1; int32_t LP_mypullsock = -1; int32_t LP_numfinished,LP_showwif,IAMLP = 0; @@ -1274,15 +1274,14 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu exit(-1); } LP_initcoins(ctx,pubsock,coinsjson); + RPC_port = myport; G.waiting = 1; - printf("got %s, initpeers. LP_mypubsock.%d\n",myipaddr,LP_mypubsock); + printf("got %s, initpeers. LP_mypubsock.%d/%d myport.%u mypullport.%d mypubport.%d pushaddr.%s\n",myipaddr,LP_mypubsock,pubsock,myport,mypullport,mypubport,pushaddr); LP_initpeers(pubsock,mypeer,myipaddr,myport,jstr(argjson,"seednode"),mypullport,mypubport); - RPC_port = myport; LP_mypullsock = LP_initpublicaddr(ctx,&mypullport,pushaddr,myipaddr,mypullport,0); strcpy(LP_publicaddr,pushaddr); LP_publicport = mypullport; - LP_mybussock = LP_coinbus(mybusport); - //LP_deadman_switch = (uint32_t)time(NULL); + //LP_mybussock = LP_coinbus(mybusport); printf("canbind.%d my command address is (%s) pullsock.%d pullport.%u\n",LP_canbind,pushaddr,LP_mypullsock,mypullport); LP_passphrase_init(passphrase,jstr(argjson,"gui"),juint(argjson,"netid"),jstr(argjson,"seednode")); #ifndef FROM_JS diff --git a/iguana/exchanges/LP_peers.c b/iguana/exchanges/LP_peers.c index 782bf90ed..193dfac6f 100644 --- a/iguana/exchanges/LP_peers.c +++ b/iguana/exchanges/LP_peers.c @@ -156,9 +156,9 @@ struct LP_peerinfo *LP_addpeer(struct LP_peerinfo *mypeer,int32_t mypubsock,char 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 ) + /*if ( IAMLP != 0 && mypubsock >= 0 ) { - struct iguana_info *coin,*ctmp; char busaddr[64]; // + //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)); @@ -173,14 +173,14 @@ 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); } -int32_t LP_coinbus(uint16_t coin_busport) +/*int32_t LP_coinbus(uint16_t coin_busport) { struct LP_peerinfo *peer,*tmp; char busaddr[64]; int32_t timeout,bussock = -1; return(-1); @@ -208,7 +208,7 @@ int32_t LP_coinbus(uint16_t coin_busport) } } return(bussock); -} +}*/ void LP_peer_recv(char *ipaddr,int32_t ismine) {