Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
540c542607
  1. 17
      iguana/SuperNET_category.c
  2. 1
      iguana/SuperNET_hexmsg.c
  3. 2
      iguana/iguana_payments.c

17
iguana/SuperNET_category.c

@ -204,14 +204,23 @@ char *SuperNET_categorymulticast(struct supernet_info *myinfo,int32_t surveyflag
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 )
char *method="",*agent="",*retstr = 0; cJSON *json,*valsobj; struct iguana_info *coin;
if ( (json= cJSON_Parse(ptr)) != 0 )
{
agent = jstr(json,"agent");
method = jstr(json,"method");
if ( (valsobj= jobj(json,"vals")) != 0 )
{
if ( jstr(valsobj,"coin") != 0 && (coin= iguana_coinfind(jstr(valsobj,"coin"))) != 0 )
{
if ( (coin->RELAYNODE != 0 || coin->VALIDATENODE != 0) && strcmp(agent,"iguana") == 0 && strcmp(method,"rawtx") == 0 )
{
return(iguana_rawtx(myinfo,coin,json,remoteaddr,jstr(json,"changeaddr"),jobj(json,"addresses"),valsobj,jstr(json,"spendscriptstr")));
}
}
}
}
printf("bitcoin_hexmsg.(%s) from %s (%s/%s)\n",buf,remoteaddr,agent,method);
printf("bitcoin_hexmsg.(%s) from %s (%s/%s)\n",ptr,remoteaddr,agent,method);
return(retstr);
}

1
iguana/SuperNET_hexmsg.c

@ -85,6 +85,7 @@ void SuperNET_hexmsgprocess(struct supernet_info *myinfo,cJSON *retjson,cJSON *j
if ( len > sizeof(_buf) )
buf = malloc(len);
decode_hex(buf,len,hexmsg);
//printf("hex.(%s) -> (%s)\n",hexmsg,buf);
categoryhash = jbits256(json,"categoryhash");
subhash = jbits256(json,"categoryhash");
if ( bits256_nonz(subhash) == 0 )

2
iguana/iguana_payments.c

@ -548,7 +548,7 @@ STRING_ARRAY_OBJ_STRING(iguana,rawtx,changeaddr,addresses,vals,spendscriptstr)
locktime = juint(vals,"locktime");
satoshis = j64bits(vals,"amount");
txfee = j64bits(vals,"txfee");
if ( (rawtxtag= juint(vals,"rawtxtag")) != 0 )
if ( (rawtxtag= juint(vals,"rawtxtag")) == 0 )
OS_randombytes((uint8_t *)&rawtxtag,sizeof(rawtxtag));
if ( (rawtx= iguana_createrawtx(myinfo,rawtxtag,symbol,&vins,locktime,satoshis,spendscriptstr,changeaddr,txfee,minconf,addresses)) != 0 )
{

Loading…
Cancel
Save