Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
a72a3bfa0f
  1. 10
      basilisk/basilisk.c
  2. 2
      iguana/main.c

10
basilisk/basilisk.c

@ -1008,7 +1008,10 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *addr,uint32_t sender
if ( myinfo->IAMRELAY != 0 ) // iguana node if ( myinfo->IAMRELAY != 0 ) // iguana node
{ {
if ( from_basilisk != 0 ) if ( from_basilisk != 0 )
{
printf("echo to other relays\n");
basilisk_sendcmd(myinfo,0,cmd,&basilisktag,0,0,origdata,origlen,-1,0); // to other iguanas basilisk_sendcmd(myinfo,0,cmd,&basilisktag,0,0,origdata,origlen,-1,0); // to other iguanas
}
if ( (retstr= (*basilisk_services[i][1])(myinfo,type,addr,remoteaddr,basilisktag,valsobj,data,datalen,hash,from_basilisk)) != 0 ) 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);
@ -1016,7 +1019,7 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *addr,uint32_t sender
basilisk_sendback(myinfo,symbol,remoteaddr,basilisktag,retstr); basilisk_sendback(myinfo,symbol,remoteaddr,basilisktag,retstr);
if ( retstr != 0 ) if ( retstr != 0 )
free(retstr); free(retstr);
} } else printf("services null return\n");
} else printf("non-relay got unexpected.(%s)\n",type); } else printf("non-relay got unexpected.(%s)\n",type);
free_json(valsobj); free_json(valsobj);
if ( coin != 0 ) if ( coin != 0 )
@ -1033,6 +1036,11 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *addr,uint32_t sender
} }
else if ( coin->RELAYNODE != 0 || coin->VALIDATENODE != 0 ) // iguana node else if ( coin->RELAYNODE != 0 || coin->VALIDATENODE != 0 ) // iguana node
{ {
if ( from_basilisk != 0 )
{
printf("echo to other relays\n");
basilisk_sendcmd(myinfo,0,cmd,&basilisktag,0,0,origdata,origlen,-1,0); // to other iguanas
}
for (i=0; i<sizeof(basilisk_coinservices)/sizeof(*basilisk_coinservices); i++) for (i=0; i<sizeof(basilisk_coinservices)/sizeof(*basilisk_coinservices); i++)
if ( strcmp((char *)basilisk_coinservices[i][0],type) == 0 ) if ( strcmp((char *)basilisk_coinservices[i][0],type) == 0 )
{ {

2
iguana/main.c

@ -1153,7 +1153,7 @@ void iguana_appletests(struct supernet_info *myinfo)
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":0,\"VALIDATE\":0,\"portp2p\":14631,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":128,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":4,\"poll\":1}"),0,myinfo->rpcport)) != 0 ) if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":0,\"VALIDATE\":0,\"portp2p\":14631,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":128,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":4,\"poll\":1}"),0,myinfo->rpcport)) != 0 )
{ {
free(str); free(str);
if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"portp2p\":8333,\"RELAY\":0,\"VALIDATE\":0,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":64,\"newcoin\":\"BTC\",\"active\":0,\"numhelpers\":4,\"poll\":100}"),0,myinfo->rpcport)) != 0 ) 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\":64,\"newcoin\":\"BTC\",\"active\":0,\"numhelpers\":4,\"poll\":100}"),0,myinfo->rpcport)) != 0 )
{ {
free(str); free(str);
if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"agent\":\"SuperNET\",\"method\":\"login\",\"handle\":\"alice\",\"password\":\"alice\",\"passphrase\":\"alice\"}"),0,myinfo->rpcport)) != 0 ) if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"agent\":\"SuperNET\",\"method\":\"login\",\"handle\":\"alice\",\"password\":\"alice\",\"passphrase\":\"alice\"}"),0,myinfo->rpcport)) != 0 )

Loading…
Cancel
Save