diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index b514cbe19..9c56e49f4 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -1395,6 +1395,18 @@ STRING_ARG(jumblr,setpassphrase,passphrase) } } +ZERO_ARGS(jumblr,runsilent) +{ + myinfo->runsilent = 1; + return(clonestr("{\"result\":\"success\",\"mode\":\"runsilent\"}")); +} + +ZERO_ARGS(jumblr,totransparent) +{ + myinfo->runsilent = 0; + return(clonestr("{\"result\":\"success\",\"mode\":\"totransparent\"}")); +} + ZERO_ARGS(jumblr,status) { cJSON *retjson; char KMDaddr[64],BTCaddr[64]; struct jumblr_item *ptr,*tmp; struct iguana_info *coinbtc; int64_t received,deposited,jumblred,step_t2z,step_z2z,step_z2t,finished,pending,maxval,minval; @@ -1404,6 +1416,7 @@ ZERO_ARGS(jumblr,status) retjson = cJSON_CreateObject(); step_t2z = step_z2z = step_z2t = deposited = finished = pending = 0; jumblr_privkey(myinfo,BTCaddr,0,KMDaddr,JUMBLR_DEPOSITPREFIX); + jaddstr(retjson,"mode",myinfo->runsilent == 0 ? "totransparent" : "runsilent"); jaddstr(retjson,"KMDdeposit",KMDaddr); jaddstr(retjson,"BTCdeposit",BTCaddr); if ( (coinbtc= iguana_coinfind("BTC")) != 0 ) diff --git a/basilisk/jumblr.c b/basilisk/jumblr.c index 305854030..05857fa8f 100755 --- a/basilisk/jumblr.c +++ b/basilisk/jumblr.c @@ -697,11 +697,11 @@ void jumblr_CMCname(char *CMCname,char *symbol) void jumblr_DEXcheck(struct supernet_info *myinfo,struct iguana_info *coin,int32_t toKMD) { double vol,avail; int32_t enabled = 0; struct iguana_info *kmdcoin,*coinbtc = 0; - kmdcoin = iguana_coinfind("KMD"); - coinbtc = iguana_coinfind("BTC"); //printf("jumblr_DEXcheck numswaps.%d notary.%d IAMLP.%d %p %p %f\n",myinfo->numswaps,myinfo->IAMNOTARY,myinfo->IAMLP,kmdcoin,coinbtc,kmdcoin->DEXinfo.btcprice); if ( myinfo->IAMNOTARY != 0 || myinfo->IAMLP != 0 || myinfo->secret[0] == 0 ) return; + kmdcoin = iguana_coinfind("KMD"); + coinbtc = iguana_coinfind("BTC"); if ( kmdcoin == 0 || coinbtc == 0 ) return; jumblr_DEXupdate(myinfo,kmdcoin,"KMD","komodo",0.,0.); @@ -847,21 +847,24 @@ void jumblr_iteration(struct supernet_info *myinfo,struct iguana_info *coin,int3 } break; case 2: // z -> public - jumblr_opidsupdate(myinfo,coin); - HASH_ITER(hh,myinfo->jumblrs,ptr,tmp) + if ( myinfo->runsilent == 0 ) { - if ( jumblr_addresstype(myinfo,coin,ptr->src) == 'z' && jumblr_addresstype(myinfo,coin,ptr->dest) == 'z' ) + jumblr_opidsupdate(myinfo,coin); + HASH_ITER(hh,myinfo->jumblrs,ptr,tmp) { - if ( (r & 1) == 0 && ptr->spent == 0 && (total= jumblr_balance(myinfo,coin,ptr->dest)) >= (fee + JUMBLR_FEE)*SATOSHIDEN ) + if ( jumblr_addresstype(myinfo,coin,ptr->src) == 'z' && jumblr_addresstype(myinfo,coin,ptr->dest) == 'z' ) { - privkey = jumblr_privkey(myinfo,BTCaddr,0,KMDaddr,""); - if ( (retstr= jumblr_sendz_to_t(myinfo,coin,ptr->dest,KMDaddr,dstr(total))) != 0 ) + if ( (r & 1) == 0 && ptr->spent == 0 && (total= jumblr_balance(myinfo,coin,ptr->dest)) >= (fee + JUMBLR_FEE)*SATOSHIDEN ) { - printf("sendz_to_t.(%s)\n",retstr); - free(retstr); + privkey = jumblr_privkey(myinfo,BTCaddr,0,KMDaddr,""); + if ( (retstr= jumblr_sendz_to_t(myinfo,coin,ptr->dest,KMDaddr,dstr(total))) != 0 ) + { + printf("sendz_to_t.(%s)\n",retstr); + free(retstr); + } + ptr->spent = (uint32_t)time(NULL); + break; } - ptr->spent = (uint32_t)time(NULL); - break; } } } diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index 9268e6df7..0185a2f77 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -772,7 +772,7 @@ int32_t dpow_vini_ismine(struct supernet_info *myinfo,struct dpow_info *dp,cJSON int32_t dpow_haveutxo(struct supernet_info *myinfo,struct iguana_info *coin,bits256 *txidp,int32_t *voutp,char *coinaddr) { - int32_t i,j,n,vout,haveutxo = 0; uint32_t r; bits256 txid; cJSON *unspents,*item; uint64_t satoshis; char *str,*address; uint8_t script[35]; + int32_t vout,haveutxo = 0; uint32_t i,j,n,r; bits256 txid; cJSON *unspents,*item; uint64_t satoshis; char *str,*address; uint8_t script[35]; memset(txidp,0,sizeof(*txidp)); *voutp = -1; if ( (unspents= dpow_listunspent(myinfo,coin,coinaddr)) != 0 ) @@ -788,9 +788,10 @@ int32_t dpow_haveutxo(struct supernet_info *myinfo,struct iguana_info *coin,bits "confirmations" : 4282, "spendable" : true },*/ - r = 0; - memcpy(&r,coin->symbol,3); - r = calc_crc32(0,(void *)&r,sizeof(r)); + //r = 0; + //memcpy(&r,coin->symbol,3); + //r = calc_crc32(0,(void *)&r,sizeof(r)); + OS_randombytes((uint8_t *)&r,sizeof(r)); for (j=0; j