Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
5a1a9bcc8c
  1. 4
      iguana/SuperNET.c
  2. 2
      iguana/SuperNET_category.c
  3. 15
      iguana/iguana_payments.c
  4. 2
      iguana/iguana_rpc.c
  5. 2
      iguana/iguana_tx.c
  6. 2
      iguana/main.c

4
iguana/SuperNET.c

@ -488,7 +488,7 @@ int32_t iguana_send_supernet(struct iguana_peer *addr,char *jsonstr,int32_t dela
checkc = SuperNET_checkc(nextprivkey,nextdestpub,&nextpubkey.txid,sizeof(nextpubkey.txid));
if ( (datalen= SuperNET_json2bits(&serialized[sizeof(struct iguana_msghdr)],IGUANA_MAXPACKETSIZE,json,nextpubkey,checkc,(uint32_t)calc_ipbits(myinfo->ipaddr),(uint32_t)calc_ipbits(addr->ipaddr),addr->validpub)) > 0 )
{
if ( 1 && jstr(json,"method") != 0 && strcmp("getpeers",jstr(json,"method")) != 0 )
if ( 0 && jstr(json,"method") != 0 && strcmp("getpeers",jstr(json,"method")) != 0 )
printf("SUPERSEND -> (%s) (%s) delaymillis.%d datalen.%d checkc.%x\n",jprint(SuperNET_bits2json(&serialized[sizeof(struct iguana_msghdr)],datalen),1),addr->ipaddr,delaymillis,datalen,checkc);
if ( 0 && memcmp(destpub.bytes,GENESIS_PUBKEY.bytes,sizeof(destpub)) == 0 )
qlen = iguana_queue_send(addr,delaymillis,serialized,"SuperNET",datalen,0,0);
@ -804,7 +804,7 @@ char *SuperNET_p2p(struct iguana_info *coin,struct iguana_peer *addr,int32_t *de
//printf("validpub.%d: %x vs %x priv.%llx senderpub.%llx\n",addr->validpub,checkc,othercheckc,(long long)myinfo->privkey.txid,(long long)senderpub.txid);
}
maxdelay = juint(json,"maxdelay");
if ( 1 && jstr(json,"method") != 0 && strcmp(jstr(json,"method"),"getpeers") != 0 )
if ( 0 && jstr(json,"method") != 0 && strcmp(jstr(json,"method"),"getpeers") != 0 )
printf("GOT >>>>>>>> SUPERNET P2P.(%s) from.%s %s valid.%d:%d\n",jprint(json,0),coin->symbol,addr->ipaddr,addr->validpub,addr->othervalid);
if ( (myipaddr= jstr(json,"yourip")) != 0 )
SuperNET_checkipaddr(SuperNET_MYINFO(0),coin,addr,myipaddr,ipaddr);

2
iguana/SuperNET_category.c

@ -207,7 +207,7 @@ char *bitcoin_hexmsg(struct supernet_info *myinfo,struct category_info *cat,void
char *method="",*agent="",*retstr = 0; cJSON *json,*valsobj; struct iguana_info *coin;
if ( (json= cJSON_Parse(ptr)) != 0 )
{
printf("bitcoinprocess.(%s)\n",jprint(json,0));
//printf("bitcoinprocess.(%s)\n",jprint(json,0));
agent = jstr(json,"agent");
method = jstr(json,"method");
if ( (valsobj= jobj(json,"vals")) != 0 && strcmp(agent,"iguana") == 0 )

15
iguana/iguana_payments.c

@ -386,12 +386,17 @@ char *iguana_rawtxissue(struct supernet_info *myinfo,uint32_t rawtxtag,char *sym
if ( (rawtx= iguana_calcrawtx(myinfo,coin,vinsp,txobj,satoshis,changeaddr,txfee,addresses,minconf)) != 0 && *vinsp != 0 )
{
free_json(txobj);
printf("return rawtx.(%s) vins.%p\n",rawtx,*vinsp);
//printf("return rawtx.(%s) vins.%p\n",rawtx,*vinsp);
return(rawtx);
}
}
}
printf("fall through case\n");
while ( (ptr= queue_dequeue(&myinfo->rawtxQ,0)) != 0 )
{
free_json(ptr->vins);
free(ptr);
}
//printf("fall through case\n");
if ( txobj != 0 )
free_json(txobj);
if ( addresses != 0 )
@ -591,11 +596,11 @@ STRING_ARRAY_OBJ_STRING(iguana,rawtx,changeaddr,addresses,vals,spendscriptstr)
return(jprint(retjson,1));
}
}
if ( addr->ipbits != 0 )
if ( 0 && addr->ipbits != 0 )
printf("i.%d (%s) vs (%s) %s\n",i,addr->ipaddr,remoteaddr,coin->symbol);
}
}
}
} else jaddstr(retjson,"result",rawtx);
free(rawtx);
} else jaddstr(retjson,"error","couldnt create rawtx");
}
@ -607,7 +612,7 @@ STRING_ARRAY_OBJ_STRING(iguana,rawtx,changeaddr,addresses,vals,spendscriptstr)
INT_ARRAY_STRING(iguana,rawtx_result,rawtxtag,vins,rawtx)
{
struct rawtx_queue *ptr = calloc(1,sizeof(*ptr) + strlen(rawtx) + 1);
printf("rawtx_result\n");
//printf("rawtx_result\n");
strcpy(ptr->rawtx,rawtx);
ptr->vins = jduplicate(vins);
ptr->rawtxtag = rawtxtag;

2
iguana/iguana_rpc.c

@ -783,7 +783,7 @@ cJSON *SuperNET_urlconv(char *value,int32_t bufsize,char *urlstr)
{
data = &urlstr[totallen - datalen];
data[-1] = 0;
printf("post.(%s) (%c)\n",data,data[0]);
//printf("post.(%s) (%c)\n",data,data[0]);
jaddstr(json,"POST",data);
}
} else break;

2
iguana/iguana_tx.c

@ -239,7 +239,9 @@ int32_t iguana_peerblockrequest(struct iguana_info *coin,uint8_t *blockspace,int
static int counter;
char str[65],str2[65];
if ( counter++ < 100 )
{
printf("error getting txi.%d [%d:%d] cmp.%s %s\n",i,bp->hdrsi,bundlei,bits256_str(str,checktxid),bits256_str(str2,T.txid));
}
break;
}
}

2
iguana/main.c

@ -306,7 +306,7 @@ char *SuperNET_processJSON(struct supernet_info *myinfo,cJSON *json,char *remote
timeout = IGUANA_JSONTIMEOUT;
if ( (method= jstr(json,"method")) != 0 && strcmp(method,"DHT") == 0 && remoteaddr != 0 && (hexmsg= jstr(json,"hexmsg")) != 0 )
{
printf("hexmsgprocess\n");
//printf("hexmsgprocess\n");
SuperNET_hexmsgprocess(myinfo,0,json,hexmsg,remoteaddr);
return(clonestr("{\"result\":\"processed remote DHT\"}"));
}

Loading…
Cancel
Save