Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
ebd4f84cc6
  1. 4
      basilisk/basilisk.c
  2. 2
      iguana/iguana_peers.c
  3. 2
      iguana/iguana_unspents.c
  4. 12
      iguana/iguana_wallet.c
  5. 2
      iguana/tests/listunspent

4
basilisk/basilisk.c

@ -256,7 +256,7 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
}
if ( s == n && valid == 1 && (destipaddr == 0 || strcmp(addr->ipaddr,destipaddr) == 0) )
{
fprintf(stderr,"(%s) ",addr->ipaddr);
//fprintf(stderr,"(%s) ",addr->ipaddr);
//printf("n.%d/fanout.%d i.%d l.%d [%s].tag%u send %s.(%s) [%x] datalen.%d addr->supernet.%u basilisk.%u to (%s).%d destip.%s\n",n,fanout,i,l,cmd,*(uint32_t *)data,type,(char *)&data[4],*(int32_t *)&data[datalen-4],datalen,addr->supernet,addr->basilisk,addr->ipaddr,addr->A.port,destipaddr!=0?destipaddr:"broadcast");
if ( encryptflag != 0 && bits256_nonz(addr->pubkey) != 0 )
{
@ -742,7 +742,7 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *_addr,uint32_t sende
//printf("FULL.%d RELAYID.%d NUMRELAYS.%d services %s\n",coin->FULLNODE,RELAYID,NUMRELAYS,type);
if ( (retstr= (*basilisk_services[i][1])(myinfo,type,addr,remoteaddr,basilisktag,valsobj,data,datalen,hash,from_basilisk)) != 0 )
{
printf("from_basilisk.%d ret.(%s)\n",from_basilisk,retstr);
//printf("from_basilisk.%d ret.(%s)\n",from_basilisk,retstr);
//if ( from_basilisk != 0 || strcmp(CMD,"GET") == 0 )
basilisk_sendback(myinfo,CMD,symbol,remoteaddr,basilisktag,retstr);
if ( retstr != 0 )

2
iguana/iguana_peers.c

@ -716,7 +716,7 @@ void iguana_startconnection(void *arg)
addr->addrind = (int32_t)(((long)addr - (long)&coin->peers->active[0]) / sizeof(*addr));
if ( addr->usock >= 0 )
{
printf("%s usock.%d skip connection\n",addr->ipaddr,addr->usock);
//printf("%s usock.%d skip connection\n",addr->ipaddr,addr->usock);
return;
}
if ( strcmp(coin->name,addr->coinname) != 0 )

2
iguana/iguana_unspents.c

@ -975,7 +975,7 @@ cJSON *iguana_RTlistunspent(struct supernet_info *myinfo,struct iguana_info *coi
}
}
}
//printf("RET.(%s)\n",jprint(retjson,0));
printf("RET.(%s)\n",jprint(retjson,0));
free_json(unspents);
}
}

12
iguana/iguana_wallet.c

@ -985,7 +985,7 @@ int64_t iguana_addressreceived(struct supernet_info *myinfo,struct iguana_info *
int64_t balance = 0; cJSON *unspentsjson,*balancejson,*item; int32_t i,n; char *balancestr;
if ( (balancestr= iguana_balance(IGUANA_CALLARGS,coin->symbol,coinaddr,1<<30,minconf)) != 0 )
{
printf("balancestr.(%s) (%s) firstheight.%d\n",balancestr,coinaddr,firstheight);
//printf("balancestr.(%s) (%s) firstheight.%d\n",balancestr,coinaddr,firstheight);
if ( (balancejson= cJSON_Parse(balancestr)) != 0 )
{
balance = jdouble(balancejson,"balance") * SATOSHIDEN;
@ -1011,10 +1011,10 @@ int64_t iguana_addressreceived(struct supernet_info *myinfo,struct iguana_info *
}
free(balancestr);
}
if ( spends != 0 )
printf("SPENDS.(%s)\n",jprint(spends,0));
if ( unspents != 0 )
printf("UNSPENTS.(%s)\n",jprint(unspents,0));
//if ( spends != 0 )
// printf("SPENDS.(%s)\n",jprint(spends,0));
//if ( unspents != 0 )
// printf("UNSPENTS.(%s)\n",jprint(unspents,0));
return(balance);
}
@ -1152,7 +1152,7 @@ ZERO_ARGS(bitcoinrpc,getinfo)
{
for (j=0; j<m; j++)
{
fprintf(stderr,"[%s] ",jstri(fullnodes,j));
//fprintf(stderr,"[%s] ",jstri(fullnodes,j));
iguana_launchpeer(coin,jstri(fullnodes,j),1);
}
}

2
iguana/tests/listunspent

@ -1 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"listunspent\",\"params\":[1, 9999999, []]}"
curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"listunspent\",\"params\":[1, 9999999, [\"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\"]]}"

Loading…
Cancel
Save