Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
7622540370
  1. 4
      basilisk/basilisk.c
  2. 4
      iguana/exchanges/bitcoin.c
  3. 16
      iguana/iguana777.c
  4. 4
      iguana/iguana_rpc.c
  5. 4
      iguana/iguana_wallet.c
  6. 8
      iguana/main.c

4
basilisk/basilisk.c

@ -208,7 +208,7 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
memset(cmd,0,sizeof(cmd));
sprintf(cmd,"SuperNET%s",type);
r = rand();
portable_mutex_lock(&myinfo->allcoins_mutex);
//portable_mutex_lock(&myinfo->allcoins_mutex);
HASH_ITER(hh,myinfo->allcoins,coin,tmp)
{
if ( coin->peers == 0 )
@ -265,7 +265,7 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
if ( n >= IGUANA_MAXPEERS*IGUANA_MAXCOINS )
break;
}
portable_mutex_unlock(&myinfo->allcoins_mutex);
//portable_mutex_unlock(&myinfo->allcoins_mutex);
free(alreadysent);
return(n);
}

4
iguana/exchanges/bitcoin.c

@ -445,7 +445,7 @@ cJSON *BALANCES(struct exchange_info *exchange,cJSON *argjson)
double balance; int16_t hdrsi; uint32_t unspentind; int32_t i,minconfirms,numunspents,max; struct iguana_info *coin,*tmp; struct supernet_info *myinfo; cJSON *retjson,*array,*item,*addresses=0; int64_t *unspents=0,value,avail;
retjson = cJSON_CreateArray();
myinfo = SuperNET_accountfind(argjson);
portable_mutex_lock(&myinfo->allcoins_mutex);
//portable_mutex_lock(&myinfo->allcoins_mutex);
HASH_ITER(hh,myinfo->allcoins,coin,tmp)
{
balance = 0.;
@ -477,7 +477,7 @@ cJSON *BALANCES(struct exchange_info *exchange,cJSON *argjson)
if ( unspents != 0 )
free(unspents);
}
portable_mutex_unlock(&myinfo->allcoins_mutex);
//portable_mutex_unlock(&myinfo->allcoins_mutex);
return(retjson);
}

16
iguana/iguana777.c

@ -31,9 +31,9 @@ struct iguana_info *iguana_coinfind(char *symbol)
sleep(1);
}
symbolcrc = calc_crc32(0,symbol,(int32_t)strlen(symbol));
portable_mutex_lock(&myinfo->allcoins_mutex);
//portable_mutex_lock(&myinfo->allcoins_mutex);
HASH_FIND(hh,myinfo->allcoins,&symbolcrc,sizeof(coin->symbolcrc),coin);
portable_mutex_unlock(&myinfo->allcoins_mutex);
//portable_mutex_unlock(&myinfo->allcoins_mutex);
return(coin);
}
@ -75,9 +75,9 @@ struct iguana_info *iguana_coinadd(char *symbol,char *name,cJSON *argjson)
basilisk_functions(coin,coin->protocol);
printf("ADD ALLCOINS.(%s) name.(%s) size %ld numvirts.%d\n",symbol,name,sizeof(*coin),myinfo->allcoins_numvirts);
coin->symbolcrc = symbolcrc = calc_crc32(0,symbol,(int32_t)strlen(symbol));
portable_mutex_lock(&myinfo->allcoins_mutex);
//portable_mutex_lock(&myinfo->allcoins_mutex);
HASH_ADD(hh,myinfo->allcoins,symbolcrc,sizeof(coin->symbolcrc),coin);
portable_mutex_unlock(&myinfo->allcoins_mutex);
//portable_mutex_unlock(&myinfo->allcoins_mutex);
myinfo->allcoins_being_added = 0;
}
if ( (coin= iguana_coinfind(symbol)) == 0 )
@ -577,7 +577,7 @@ void iguana_helper(void *arg)
{
maxmillis = (10000 / myinfo->allcoins_numvirts) + 1;
flag = 0;
portable_mutex_lock(&myinfo->allcoins_mutex);
//portable_mutex_lock(&myinfo->allcoins_mutex);
HASH_ITER(hh,myinfo->allcoins,virt,tmp)
{
if ( virt->started != 0 && virt->active != 0 && virt->virtualchain != 0 )
@ -587,14 +587,14 @@ void iguana_helper(void *arg)
gecko_iteration(myinfo,btcd,virt,maxmillis);
}
}
portable_mutex_unlock(&myinfo->allcoins_mutex);
//portable_mutex_unlock(&myinfo->allcoins_mutex);
}
}
//iguana_jsonQ(); cant do this here
flag = 0;
allcurrent = 2;
polltimeout = 100;
portable_mutex_lock(&myinfo->allcoins_mutex);
//portable_mutex_lock(&myinfo->allcoins_mutex);
HASH_ITER(hh,myinfo->allcoins,coin,tmp)
{
if ( coin->spendvectorsaved == 1 )
@ -606,7 +606,7 @@ void iguana_helper(void *arg)
iguana_bundlevalidate(coin,bp,0);
}
}
portable_mutex_unlock(&myinfo->allcoins_mutex);
//portable_mutex_unlock(&myinfo->allcoins_mutex);
n = queue_size(&bundlesQ);
for (iter=0; iter<n; iter++)
{

4
iguana/iguana_rpc.c

@ -692,14 +692,14 @@ char *iguana_bitcoinRPC(struct supernet_info *myinfo,char *method,cJSON *json,ch
}
else
{
portable_mutex_lock(&myinfo->allcoins_mutex);
//portable_mutex_lock(&myinfo->allcoins_mutex);
HASH_ITER(hh,myinfo->allcoins,coin,tmp)
{
if ( coin->chain->rpcport == port )
break;
else coin = 0;
}
portable_mutex_unlock(&myinfo->allcoins_mutex);
//portable_mutex_unlock(&myinfo->allcoins_mutex);
}
if ( coin == 0 && symbol[0] != 0 )
coin = iguana_coinfind(symbol);

4
iguana/iguana_wallet.c

@ -930,7 +930,7 @@ STRING_ARG(bitcoinrpc,validateaddress,address)
cJSON_AddTrueToObject(retjson,"ismine");
}
else cJSON_AddFalseToObject(retjson,"ismine");
portable_mutex_lock(&myinfo->allcoins_mutex);
//portable_mutex_lock(&myinfo->allcoins_mutex);
HASH_ITER(hh,myinfo->allcoins,other,tmp)
{
if ( strcmp(other->symbol,coin->symbol) != 0 )
@ -939,7 +939,7 @@ STRING_ARG(bitcoinrpc,validateaddress,address)
jaddstr(retjson,other->symbol,str);
}
}
portable_mutex_unlock(&myinfo->allcoins_mutex);
//portable_mutex_unlock(&myinfo->allcoins_mutex);
return(jprint(retjson,1));
}

8
iguana/main.c

@ -414,7 +414,7 @@ void mainloop(struct supernet_info *myinfo)
if ( 1 )
{
coin = 0;
portable_mutex_lock(&myinfo->allcoins_mutex);
//portable_mutex_lock(&myinfo->allcoins_mutex);
HASH_ITER(hh,myinfo->allcoins,coin,tmp)
{
if ( coin->current != 0 && coin->active != 0 && coin->started != 0 )
@ -467,7 +467,7 @@ void mainloop(struct supernet_info *myinfo)
printf("call RT update busy.%d\n",coin->RTramchain_busy);
}
}
portable_mutex_unlock(&myinfo->allcoins_mutex);
//portable_mutex_unlock(&myinfo->allcoins_mutex);
}
//pangea_queues(SuperNET_MYINFO(0));
if ( flag == 0 )
@ -1932,12 +1932,12 @@ STRING_ARG(SuperNET,getpeers,activecoin)
max = SuperNET_coinpeers(coin,SNjson,rawjson,max);
else
{
portable_mutex_lock(&myinfo->allcoins_mutex);
//portable_mutex_lock(&myinfo->allcoins_mutex);
HASH_ITER(hh,myinfo->allcoins,coin,tmp)
{
max = SuperNET_coinpeers(coin,SNjson,rawjson,max);
}
portable_mutex_unlock(&myinfo->allcoins_mutex);
//portable_mutex_unlock(&myinfo->allcoins_mutex);
}
if ( max != 64 )
{

Loading…
Cancel
Save