Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
e3778e93de
  1. 2
      iguana/SuperNET.h
  2. 21
      iguana/SuperNET_category.c
  3. 1
      iguana/iguana_payments.c

2
iguana/SuperNET.h

@ -80,7 +80,7 @@ struct supernet_info
char ipaddr[64],transport[8]; int32_t APISLEEP; int32_t iamrelay; uint32_t expiration,dirty;
int32_t Debuglevel,readyflag,dead,POLLTIMEOUT; char rpcsymbol[16],LBpoint[64],PUBpoint[64];
//int32_t pullsock,subclient,lbclient,lbserver,servicesock,pubglobal,pubrelays,numservers;
bits256 privkey,persistent_priv,BTCmarkerhash,instantdex_category,pangea_category;
bits256 privkey,persistent_priv,BTCmarkerhash,instantdex_category,pangea_category,bitcoin_category;
char secret[2048],NXTAPIURL[512],permanentfile[1024];
uint8_t *recvbuf[6];
struct supernet_address myaddr;

21
iguana/SuperNET_category.c

@ -202,9 +202,22 @@ char *SuperNET_categorymulticast(struct supernet_info *myinfo,int32_t surveyflag
return(retstr);
}
char *bitcoin_hexmsg(struct supernet_info *myinfo,struct category_info *cat,void *ptr,int32_t len,char *remoteaddr)
{
char buf[IGUANA_MAXSCRIPTSIZE],*method="",*agent="",*retstr = 0; cJSON *json;
decode_hex((uint8_t *)buf,len,ptr);
if ( (json= cJSON_Parse(buf)) != 0 )
{
agent = jstr(json,"agent");
method = jstr(json,"method");
}
printf("bitcoin_hexmsg.(%s) from %s (%s/%s)\n",buf,remoteaddr,agent,method);
return(retstr);
}
void category_init(struct supernet_info *myinfo)
{
bits256 pangeahash,instantdexhash;
bits256 pangeahash,instantdexhash,bitcoinhash;
category_subscribe(myinfo,GENESIS_PUBKEY,GENESIS_PUBKEY);
pangeahash = calc_categoryhashes(0,"pangea",0);
myinfo->pangea_category = pangeahash;
@ -217,5 +230,9 @@ void category_init(struct supernet_info *myinfo)
category_processfunc(instantdexhash,GENESIS_PUBKEY,InstantDEX_hexmsg);
category_processfunc(instantdexhash,myinfo->myaddr.persistent,InstantDEX_hexmsg);
//exchanges777_init(myinfo,0,0);
bitcoinhash = calc_categoryhashes(0,"InstantDEX",0);
myinfo->bitcoin_category = bitcoinhash;
category_subscribe(myinfo,bitcoinhash,GENESIS_PUBKEY);
category_processfunc(bitcoinhash,GENESIS_PUBKEY,bitcoin_hexmsg);
category_processfunc(bitcoinhash,myinfo->myaddr.persistent,bitcoin_hexmsg);
}

1
iguana/iguana_payments.c

@ -418,6 +418,7 @@ char *iguana_rawtxissue(struct supernet_info *myinfo,uint32_t rawtxtag,char *sym
jaddstr(reqjson,"agent","SuperNET");
jaddstr(reqjson,"method","DHT");
jaddnum(reqjson,"plaintext",1);
jaddbits256(reqjson,"category",myinfo->bitcoin_category);
jaddnum(reqjson,"request",1);
jaddnum(reqjson,"timeout",5000);
jaddstr(reqjson,"hexmsg",(char *)buf);

Loading…
Cancel
Save