Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
1f009f4c9d
  1. 4
      basilisk/basilisk.c
  2. 4
      iguana/iguana_peers.c
  3. 11
      iguana/iguana_wallet.c
  4. 1
      iguana/tests/getinfo2
  5. 1
      includes/iguana_funcs.h

4
basilisk/basilisk.c

@ -49,7 +49,7 @@ uint32_t basilisk_calcnonce(struct supernet_info *myinfo,uint8_t *data,int32_t d
}
iguana_rwnum(0,(void *)hash.uints,sizeof(basilisktag),&basilisktag);
iguana_rwnum(1,&data[-(int32_t)sizeof(basilisktag)],sizeof(basilisktag),&basilisktag);
char str[65],str2[65]; printf("found hash after numiters.%d %s vs %s basilisktag.%u\n",numiters,bits256_str(str,threshold),bits256_str(str2,hash2),basilisktag);
//char str[65],str2[65]; printf("found hash after numiters.%d %s vs %s basilisktag.%u\n",numiters,bits256_str(str,threshold),bits256_str(str2,hash2),basilisktag);
return(basilisktag);
}
@ -704,7 +704,7 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *_addr,uint32_t sende
{
if ( coin->FULLNODE != 0 || RELAYID >= 0 ) // iguana node
{
//printf("services %s\n",type);
printf("services %s\n",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);

4
iguana/iguana_peers.c

@ -722,7 +722,7 @@ void iguana_startconnection(void *arg)
printf("avoid self-loopback\n");
return;
}
printf(">>>>>>>> startconnection.(%s) pending.%u usock.%d addrind.%d\n",addr->ipaddr,addr->pending,addr->usock,addr->addrind);
//printf(">>>>>>>> startconnection.(%s) pending.%u usock.%d addrind.%d\n",addr->ipaddr,addr->pending,addr->usock,addr->addrind);
addr->pending = (uint32_t)time(NULL);
if ( (port= (uint16_t)(addr->ipbits >> 32)) == 0 )
port = coin->chain->portp2p;
@ -731,7 +731,7 @@ void iguana_startconnection(void *arg)
if ( addr->usock < 0 || (coin->peers != 0 && coin->peers->shuttingdown != 0) )
{
strcpy(ipaddr,addr->ipaddr);
printf("%s refused PEER KILLED. slot.%d for %s:%d usock.%d\n",coin->symbol,addr->addrind,ipaddr,coin->chain->portp2p,addr->usock);
//printf("%s refused PEER KILLED. slot.%d for %s:%d usock.%d\n",coin->symbol,addr->addrind,ipaddr,coin->chain->portp2p,addr->usock);
iguana_iAkill(coin,addr,1);
}
else

11
iguana/iguana_wallet.c

@ -1112,9 +1112,20 @@ cJSON *iguana_getinfo(struct supernet_info *myinfo,struct iguana_info *coin)
ZERO_ARGS(bitcoinrpc,getinfo)
{
struct basilisk_item Lptr,*ptr; cJSON *valsobj;
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
if ( coin->FULLNODE != 0 || coin->VALIDATENODE != 0 )
return(jprint(iguana_getinfo(myinfo,coin),1));
else
{
valsobj = cJSON_CreateObject();
ptr = basilisk_getinfo(&Lptr,myinfo,coin,remoteaddr,0,1000,valsobj);
free_json(valsobj);
if ( ptr != 0 )
return(ptr->retstr);
else return(clonestr("{\"error\":\"null basilisk_getinfo\"}"));
}
}
TWO_STRINGS(bitcoinrpc,setaccount,address,account)

1
iguana/tests/getinfo2

@ -0,0 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"method\":\"getinfo\",\"params\":[]}"

1
includes/iguana_funcs.h

@ -242,6 +242,7 @@ void iguana_peerkill(struct iguana_info *coin);
int32_t blockhash_sha256(uint8_t *blockhashp,uint8_t *serialized,int32_t len);
void iguana_nameset(char name[64],char *symbol,cJSON *json);
cJSON *iguana_getinfo(struct supernet_info *myinfo,struct iguana_info *coin);
void *basilisk_getinfo(struct basilisk_item *Lptr,struct supernet_info *myinfo,struct iguana_info *coin,char *remoteaddr,uint32_t basilisktag,int32_t timeoutmillis,cJSON *valsobj);
char *busdata_sync(uint32_t *noncep,char *jsonstr,char *broadcastmode,char *destNXTaddr);
void peggy();

Loading…
Cancel
Save