From 9086252b42fb4daba1d3ac9f70b2a89bd0d7224a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 26 Sep 2016 18:42:41 -0300 Subject: [PATCH] test --- basilisk/basilisk_swap.c | 11 ++--------- iguana/iguana_sign.c | 6 ++++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/basilisk/basilisk_swap.c b/basilisk/basilisk_swap.c index f66de639c..08ed84783 100755 --- a/basilisk/basilisk_swap.c +++ b/basilisk/basilisk_swap.c @@ -348,13 +348,6 @@ int32_t basilisk_rawtx_spendscript(struct supernet_info *myinfo,int32_t height,s int32_t basilisk_swapuserdata(uint8_t *userdata,int32_t pushpriv,bits256 privkey,uint8_t addrtype,bits256 pubkey,int32_t ifpath,int32_t revflag) { int32_t i,len = 0; - if ( 0 ) - { - userdata[len++] = 33; - userdata[len++] = addrtype; - for (i=0; iprivBn,0x03,swap->pubB0,0,0); + len = basilisk_swapuserdata(userdata,1,swap->privBn,0x03,swap->pubB0,0,1); int32_t i; for (i=0; iprivBn)); @@ -426,7 +419,7 @@ int32_t basilisk_verify_bobpaid(struct supernet_info *myinfo,void *ptr,uint8_t * uint8_t userdata[512]; int32_t len = 0; struct basilisk_swap *swap = ptr; if ( basilisk_rawtx_spendscript(myinfo,swap->bobcoin->blocks.hwmchain.height,&swap->bobpayment,0,data,datalen,0) == 0 ) { - len = basilisk_swapuserdata(userdata,1,swap->privAm,0x02,swap->pubA0,0,0); + len = basilisk_swapuserdata(userdata,1,swap->privAm,0x02,swap->pubA0,0,1); char str[65]; printf("bobpaid.(%s)\n",bits256_str(str,swap->privAm)); return(basilisk_rawtx_sign(myinfo,swap->bobcoin->blocks.hwmchain.height,swap,&swap->alicespend,&swap->bobpayment,swap->myprivs[0],0,userdata,len)); } else return(-1); diff --git a/iguana/iguana_sign.c b/iguana/iguana_sign.c index 36c78b12c..b380310fa 100755 --- a/iguana/iguana_sign.c +++ b/iguana/iguana_sign.c @@ -1253,7 +1253,7 @@ cJSON *bitcoin_txoutput(cJSON *txobj,uint8_t *paymentscript,int32_t len,uint64_t int32_t iguana_interpreter(struct iguana_info *coin,cJSON *logarray,int64_t nLockTime,struct vin_info *V,int32_t numvins) { - uint8_t script[IGUANA_MAXSCRIPTSIZE],*activescript; char str[IGUANA_MAXSCRIPTSIZE*2+1]; int32_t vini,scriptlen,activescriptlen,errs = 0; cJSON *spendscript,*item; + uint8_t script[IGUANA_MAXSCRIPTSIZE],*activescript; char str[IGUANA_MAXSCRIPTSIZE*2+1]; int32_t vini,i,scriptlen,activescriptlen,errs = 0; cJSON *spendscript,*item; for (vini=0; vini 0 ) @@ -1276,6 +1276,8 @@ int32_t iguana_interpreter(struct iguana_info *coin,cJSON *logarray,int64_t nLoc } else if ( scriptlen != activescriptlen || memcmp(script,activescript,scriptlen) != 0 ) { + for (i=0; i