Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
cf84348863
  1. 1
      iguana/iguana_init.c
  2. 2
      iguana/iguana_recv.c
  3. 7
      iguana/iguana_unspents.c
  4. 2
      iguana/main.c
  5. 2
      includes/iguana_structs.h

1
iguana/iguana_init.c

@ -61,6 +61,7 @@ void iguana_initcoin(struct iguana_info *coin,cJSON *argjson)
if ( coin->instance_nonce == 0 )
{
sprintf(dirname,"%s/%s",GLOBAL_TMPDIR,coin->symbol), OS_portable_path(dirname);
portable_mutex_init(&coin->RTmutex);
portable_mutex_init(&coin->peers_mutex);
portable_mutex_init(&coin->blocks_mutex);
coin->txfee = 10000;

2
iguana/iguana_recv.c

@ -1641,6 +1641,7 @@ int32_t iguana_processrecv(struct supernet_info *myinfo,struct iguana_info *coin
{
int32_t i,newhwm = 0,hwmheight,flag = 0; char str[2000];
hwmheight = coin->blocks.hwmchain.height;
portable_mutex_lock(&coin->RTmutex);
coin->RTramchain_busy = 1;
if ( coin->balanceflush != 0 )
{
@ -1675,6 +1676,7 @@ int32_t iguana_processrecv(struct supernet_info *myinfo,struct iguana_info *coin
}
}
coin->RTramchain_busy = 0;//(coin->RTgenesis == 0);
portable_mutex_unlock(&coin->RTmutex);
flag += iguana_process_msgrequestQ(myinfo,coin);
//if ( strcmp("BTCD",coin->symbol) == 0 )
// instantdex_update(SuperNET_MYINFO(0));

7
iguana/iguana_unspents.c

@ -524,11 +524,9 @@ int32_t iguana_pkhasharray(struct supernet_info *myinfo,struct iguana_info *coin
int64_t iguana_unspents(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *array,int32_t minconf,int32_t maxconf,uint8_t *rmdarray,int32_t numrmds,int32_t lastheight,int64_t *unspents,int32_t *numunspentsp,char *remoteaddr)
{
int64_t total=0,sum=0; struct iguana_pkhash *P; uint8_t *addrtypes,*pubkeys; int32_t i,numunspents,maxunspents,flag = 0; char coinaddr[64];
while ( coin->RTramchain_busy != 0 )
{
portable_mutex_lock(&coin->RTmutex);
if ( coin->RTramchain_busy != 0 )
fprintf(stderr,"iguana_pkhasharray: unexpected access when RTramchain_busy\n");
sleep(3);
}
numunspents = 0;
maxunspents = *numunspentsp;
if ( rmdarray == 0 )
@ -553,6 +551,7 @@ int64_t iguana_unspents(struct supernet_info *myinfo,struct iguana_info *coin,cJ
*numunspentsp = numunspents;
if ( flag != 0 && rmdarray != 0 )
free(rmdarray);
portable_mutex_unlock(&coin->RTmutex);
return(sum);
}

2
iguana/main.c

@ -551,7 +551,7 @@ void iguana_appletests(struct supernet_info *myinfo)
bitcoin_sharedsecret(myinfo->ctx,hash2,pubkey,33);
printf("secp256k1 elapsed %.3f for %d iterations\n",OS_milliseconds() - startmillis,i);
getchar();**/
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":1,\"VALIDATE\":0,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":8,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":1}"),0,myinfo->rpcport)) != 0 )
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":0,\"VALIDATE\":0,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":8,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":1}"),0,myinfo->rpcport)) != 0 )
{
free(str);
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"portp2p\":8333,\"RELAY\":0,\"VALIDATE\":0,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":8,\"newcoin\":\"BTC\",\"active\":0,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 )

2
includes/iguana_structs.h

@ -401,7 +401,7 @@ struct iguana_info
struct OS_memspace TXMEM,MEM,MEMB[IGUANA_MAXBUNDLESIZE];
queue_t acceptQ,hdrsQ,blocksQ,priorityQ,possibleQ,cacheQ,recvQ,msgrequestQ;
double parsemillis,avetime; uint32_t Launched[8],Terminated[8];
portable_mutex_t peers_mutex,blocks_mutex,special_mutex;
portable_mutex_t peers_mutex,blocks_mutex,special_mutex,RTmutex;
char changeaddr[64];
struct iguana_bundle *bundles[IGUANA_MAXBUNDLES],*current,*lastpending;
struct iguana_ramchain RTramchain; struct OS_memspace RTmem,RThashmem; bits256 RThash1;

Loading…
Cancel
Save