From 19768b1c08f6f3456dcaacac284b40be0ab853fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 11 Mar 2017 21:08:55 +0200 Subject: [PATCH] Test --- basilisk/basilisk_swap.c | 6 +++--- iguana/iguana_sign.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/basilisk/basilisk_swap.c b/basilisk/basilisk_swap.c index e06c8f96d..1d317ee60 100755 --- a/basilisk/basilisk_swap.c +++ b/basilisk/basilisk_swap.c @@ -481,7 +481,7 @@ int32_t basilisk_rawtx_return(struct supernet_info *myinfo,int32_t height,struct rawtx->I.datalen = (int32_t)strlen(signedtx) >> 1; //rawtx->txbytes = calloc(1,rawtx->I.datalen); decode_hex(rawtx->txbytes,rawtx->I.datalen,signedtx); - printf("%s SIGNEDTX.(%s)\n",rawtx->name,signedtx); + //printf("%s SIGNEDTX.(%s)\n",rawtx->name,signedtx); free(signedtx); retval = 0; } else printf("error signrawtx\n"); //do a very short timeout so it finishes via local poll @@ -559,9 +559,9 @@ int32_t _basilisk_rawtx_gen(char *str,struct supernet_info *myinfo,uint32_t swap int32_t basilisk_rawtx_gen(char *str,struct supernet_info *myinfo,uint32_t swapstarted,uint8_t *pubkey33,int32_t iambob,int32_t lockinputs,struct basilisk_rawtx *rawtx,uint32_t locktime,uint8_t *script,int32_t scriptlen,int64_t txfee,int32_t minconf,int32_t delay) { int32_t retval,len; uint64_t newtxfee; struct iguana_info *coin; - retval = _basilisk_rawtx_gen(str,myinfo,swapstarted,pubkey33,iambob,lockinputs,rawtx,locktime,script,scriptlen,txfee,minconf,delay); if ( (coin= rawtx->coin) == 0 || strcmp(coin->symbol,"BTC") != 0 ) - return(retval); + return(_basilisk_rawtx_gen(str,myinfo,swapstarted,pubkey33,iambob,lockinputs,rawtx,locktime,script,scriptlen,txfee,minconf,delay)); + retval = _basilisk_rawtx_gen(str,myinfo,swapstarted,pubkey33,iambob,0,rawtx,locktime,script,scriptlen,txfee,minconf,delay); len = rawtx->I.datalen; if ( coin->estimatedfee == 0 ) coin->estimatedfee = iguana_getestimatedfee(myinfo,coin); diff --git a/iguana/iguana_sign.c b/iguana/iguana_sign.c index 1076aee21..97b0b2006 100755 --- a/iguana/iguana_sign.c +++ b/iguana/iguana_sign.c @@ -673,7 +673,7 @@ int32_t iguana_rwmsgtx(struct iguana_info *coin,int32_t height,int32_t rwflag,cJ jaddi(voutarray,iguana_voutjson(coin,&msg->vouts[i],i,*txidp)); } len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->lock_time),&msg->lock_time); -printf("lock_time.%08x len.%d\n",msg->lock_time,len); +//printf("lock_time.%08x len.%d\n",msg->lock_time,len); if ( strcmp(coin->symbol,"VPN") == 0 ) { uint16_t ddosflag = 0; @@ -727,7 +727,7 @@ printf("lock_time.%08x len.%d\n",msg->lock_time,len); jaddnum(json,"locktime",msg->lock_time); jaddnum(json,"size",len); jaddbits256(json,"txid",*txidp); - printf("TX.(%s) %p\n",jprint(json,0),json); + //printf("TX.(%s) %p\n",jprint(json,0),json); } msg->allocsize = len; return(len); @@ -1381,11 +1381,11 @@ int32_t iguana_signrawtransaction(struct supernet_info *myinfo,struct iguana_inf //printf("call hex2json.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); if ( (txobj= bitcoin_hex2json(coin,height,&txid,msgtx,rawtx,extraspace,extralen,serialized4,vins,V->suppress_pubkeys)) != 0 ) { - printf("back from bitcoin_hex2json (%s)\n",jprint(vins,0)); + //printf("back from bitcoin_hex2json (%s)\n",jprint(vins,0)); } else fprintf(stderr,"no txobj from bitcoin_hex2json\n"); if ( (numinputs= cJSON_GetArraySize(vins)) > 0 ) { - printf("numinputs.%d msgtx.%d\n",numinputs,msgtx->tx_in); + //printf("numinputs.%d msgtx.%d\n",numinputs,msgtx->tx_in); memset(msgtx,0,sizeof(*msgtx)); if ( iguana_rwmsgtx(coin,height,0,0,serialized,maxsize,msgtx,&txid,"",extraspace,65536,vins,V->suppress_pubkeys) > 0 && numinputs == msgtx->tx_in ) { @@ -1405,7 +1405,7 @@ int32_t iguana_signrawtransaction(struct supernet_info *myinfo,struct iguana_inf iguana_ensure_privkey(myinfo,coin,privkey); } } - printf("after privkeys tx_in.%d\n",msgtx->tx_in); + //printf("after privkeys tx_in.%d\n",msgtx->tx_in); for (i=0; itx_in; i++) { if ( msgtx->vins[i].p2shlen != 0 ) @@ -1473,7 +1473,7 @@ int32_t iguana_signrawtransaction(struct supernet_info *myinfo,struct iguana_inf } } finalized = iguana_vininfo_create(myinfo,coin,serialized2,maxsize,msgtx,vins,numinputs,V); - printf("finalized.%d\n",finalized); + //printf("finalized.%d\n",finalized); if ( (complete= bitcoin_verifyvins(coin,height,signedtxidp,&signedtx,msgtx,serialized3,maxsize,V,SIGHASH_ALL,1,V->suppress_pubkeys)) > 0 && signedtx != 0 ) { int32_t tmp; char str[65];