From 62dcc3b216d0f542f0023045be1c4d80b9172bdd Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 27 Sep 2016 12:20:03 -0300 Subject: [PATCH] test --- basilisk/basilisk_DEX.c | 4 ++-- basilisk/basilisk_swap.c | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/basilisk/basilisk_DEX.c b/basilisk/basilisk_DEX.c index 217f1e757..03b38074a 100755 --- a/basilisk/basilisk_DEX.c +++ b/basilisk/basilisk_DEX.c @@ -291,7 +291,7 @@ void basilisk_requests_poll(struct supernet_info *myinfo) basilisk_channelsend(myinfo,issueR.desthash,issueR.srchash,channel,msgid,data,datalen,INSTANTDEX_LOCKTIME*2); while ( numiters < 10 && (crc= basilisk_swapcrcsend(myinfo,buf,sizeof(buf),issueR.desthash,issueR.srchash,channel,msgid,data,datalen,crcs)) == 0 ) { - printf("didnt get back what was sent\n"); + //printf("didnt get back what was sent\n"); sleep(3); basilisk_channelsend(myinfo,issueR.desthash,issueR.srchash,channel,msgid,data,datalen,INSTANTDEX_LOCKTIME*2); numiters++; @@ -547,7 +547,7 @@ HASH_ARRAY_STRING(InstantDEX,request,hash,vals,hexstr) sleep(3); while ( numiters < 10 && (crc= basilisk_swapcrcsend(myinfo,buf,sizeof(buf),hash,myinfo->myaddr.persistent,DEX_channel,msgid,serialized,datalen,crcs)) == 0 ) { - printf("didnt get back what was sent\n"); + //printf("didnt get back what was sent\n"); sleep(3); basilisk_channelsend(myinfo,myinfo->myaddr.persistent,hash,DEX_channel,msgid,serialized,datalen,60); numiters++; diff --git a/basilisk/basilisk_swap.c b/basilisk/basilisk_swap.c index 84c0ad940..35a7be139 100755 --- a/basilisk/basilisk_swap.c +++ b/basilisk/basilisk_swap.c @@ -335,7 +335,7 @@ int32_t basilisk_rawtx_sign(struct supernet_info *myinfo,int32_t height,struct b txobj = bitcoin_txoutput(txobj,dest->spendscript,dest->spendlen,dest->amount); if ( (rawtxbytes= bitcoin_json2hex(myinfo,rawtx->coin,&dest->txid,txobj,V)) != 0 ) { - //printf("needsig.%d (%s) spend.%s rawtx.(%s) userdatalen.%d p2shlen.%d\n",needsig,jprint(txobj,0),rawtx->name,rawtxbytes,userdatalen,dest->redeemlen); + printf("needsig.%d (%s) spend.%s rawtx.(%s) userdatalen.%d p2shlen.%d\n",needsig,jprint(txobj,0),rawtx->name,rawtxbytes,userdatalen,dest->redeemlen); if ( needsig == 0 ) signedtx = rawtxbytes; if ( signedtx != 0 || (signedtx= iguana_signrawtx(myinfo,rawtx->coin,height,&dest->signedtxid,&dest->completed,vins,rawtxbytes,privkeys,V)) != 0 ) @@ -410,6 +410,11 @@ int32_t basilisk_rawtx_spendscript(struct supernet_info *myinfo,struct basilisk_ { decode_hex(rawtx->spendscript,hexlen,hexstr); rawtx->spendlen = hexlen; + if ( (hexstr= jstr(vout,"redeemScript")) != 0 && (hexlen= (int32_t)strlen(hexstr) >> 1) < sizeof(rawtx->spendscript) ) + { + decode_hex(rawtx->redeemscript,hexlen,hexstr); + rawtx->redeemlen = hexlen; + } basilisk_txlog(myinfo,swap,rawtx,-1); // bobdeposit, bobpayment or alicepayment retval = 0; } @@ -435,6 +440,7 @@ int32_t basilisk_swapuserdata(uint8_t *userdata,bits256 privkey,int32_t ifpath,b userdata[len++] = privkey.bytes[i]; } userdata[len++] = 0x51 * ifpath; // ifpath == 1 -> if path, 0 -> else path +#ifdef DISABLE_CHECKSIG if ( redeemscript != 0 && redeemlen > 0 ) { if ( redeemlen < 76 ) @@ -452,6 +458,7 @@ int32_t basilisk_swapuserdata(uint8_t *userdata,bits256 privkey,int32_t ifpath,b } memcpy(&userdata[len],redeemscript,redeemlen), len += redeemlen; } +#endif return(len); }