From ecdb8749beb923660de5e44afe038ae9efd0319e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 May 2016 14:56:43 -0500 Subject: [PATCH] test --- iguana/SuperNET.c | 7 +++++-- iguana/tests/rawtx | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/SuperNET.c b/iguana/SuperNET.c index 75a09e645..f24c8cff1 100755 --- a/iguana/SuperNET.c +++ b/iguana/SuperNET.c @@ -480,7 +480,7 @@ int32_t iguana_send_supernet(struct iguana_peer *addr,char *jsonstr,int32_t dela iguana_setkeys(myinfo,addr,&privkey,&pubkey,&destpub,&nextprivkey,&nextpubkey,&nextdestpub); if ( juint(json,"plaintext") == 0 && juint(json,"broadcast") == 0 && memcmp(destpub.bytes,GENESIS_PUBKEY.bytes,sizeof(pubkey)) == 0 ) { - //printf("reject broadcasting non-plaintext! (%s)\n",jsonstr); //getchar(); + printf("reject broadcasting non-plaintext! (%s)\n",jsonstr); //getchar(); free_json(json); return(-1); } @@ -491,7 +491,10 @@ int32_t iguana_send_supernet(struct iguana_peer *addr,char *jsonstr,int32_t dela 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 ( 1 && memcmp(destpub.bytes,GENESIS_PUBKEY.bytes,sizeof(destpub)) == 0 ) + { qlen = iguana_queue_send(addr,delaymillis,serialized,"SuperNET",datalen,0,0); + printf("send broadcast\n"); + } else { if ( (cipher= SuperNET_ciphercalc(&ptr,&cipherlen,&privkey,&destpub,&serialized[sizeof(struct iguana_msghdr)],datalen,space2,sizeof(space2))) != 0 ) @@ -511,7 +514,7 @@ int32_t iguana_send_supernet(struct iguana_peer *addr,char *jsonstr,int32_t dela free(ptr); } } - } + } else printf("error json2bits\n"); free(serialized); } else printf("cant parse.(%s)\n",jsonstr); return(qlen); diff --git a/iguana/tests/rawtx b/iguana/tests/rawtx index d3d02f00c..7d51dbf7a 100755 --- a/iguana/tests/rawtx +++ b/iguana/tests/rawtx @@ -1 +1 @@ -curl --url "http://127.0.0.1:7778" --data "{\"timeout\":25000,\"agent\":\"basilisk\",\"method\":\"rawtx\",\"changeaddr\":\"1Hgzt5xsnbfc8UTWqWKSTLRm5bEYHYBoCE\",\"addresses\":[\"1Hgzt5xsnbfc8UTWqWKSTLRm5bEYHYBoCE\"],\"vals\":{\"coin\":\"BTC\",\"amount\":\"20000\"},\"spendscriptstr\":\"76a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac\"}" +curl --url "http://127.0.0.1:7778" --data "{\"timeout\":2000,\"agent\":\"basilisk\",\"method\":\"rawtx\",\"changeaddr\":\"1Hgzt5xsnbfc8UTWqWKSTLRm5bEYHYBoCE\",\"addresses\":[\"1Hgzt5xsnbfc8UTWqWKSTLRm5bEYHYBoCE\"],\"vals\":{\"coin\":\"BTC\",\"amount\":\"20000\"},\"spendscriptstr\":\"76a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac\"}"