jl777 8 years ago
parent
commit
3147bb604b
  1. 4
      basilisk/basilisk_swap.c
  2. 7
      iguana/iguana_interpreter.c
  3. 6
      iguana/iguana_sign.c

4
basilisk/basilisk_swap.c

@ -457,7 +457,7 @@ int32_t basilisk_swapuserdata(struct basilisk_swap *swap,uint8_t *userdata,bits2
{
userdata[len++] = sizeof(privkey);
for (i=0; i<sizeof(privkey); i++)
userdata[len++] = privkey.bytes[31 - i];
userdata[len++] = privkey.bytes[i];
}
userdata[len++] = 0x51 * ifpath; // ifpath == 1 -> if path, 0 -> else path
return(len);
@ -528,7 +528,7 @@ int32_t basilisk_verify_bobpaid(struct supernet_info *myinfo,void *ptr,uint8_t *
{
for (i=0; i<32; i++)
revAm.bytes[i] = swap->privAm.bytes[31-i];
len = basilisk_swapuserdata(swap,userdata,swap->privAm,0,swap->myprivs[0],swap->bobpayment.redeemscript,swap->bobpayment.redeemlen);
len = basilisk_swapuserdata(swap,userdata,revAm,0,swap->myprivs[0],swap->bobpayment.redeemscript,swap->bobpayment.redeemlen);
char str[65]; printf("bobpaid.(%s)\n",bits256_str(str,swap->privAm));
if ( (retval= basilisk_rawtx_sign(myinfo,swap->bobcoin->blocks.hwmchain.height,swap,&swap->alicespend,&swap->bobpayment,swap->myprivs[0],0,userdata,len)) == 0 )
{

7
iguana/iguana_interpreter.c

@ -1365,7 +1365,7 @@ int32_t bitcoin_assembler(struct iguana_info *coin,cJSON *logarray,uint8_t scrip
{
revcalc_rmd160_sha256(rmd160,*(bits256 *)databuf);
printf("SPECIAL CASE REVERSE\n");
} else*/
} else
for (i=0; i<32; i++)
printf("%02x",databuf[i]);
printf(" <- databuf\n");
@ -1383,7 +1383,10 @@ int32_t bitcoin_assembler(struct iguana_info *coin,cJSON *logarray,uint8_t scrip
calc_rmd160_sha256(rmd160,databuf,datalen);
for (i=0; i<20; i++)
printf("%02x",rmd160[i]);
printf(" <- rmd160 databuf\n");
printf(" <- rmd160 databuf\n");*/
if ( datalen == 32 )
calc_rmd160_sha256(rmd160,revdatabuf,datalen);
else calc_rmd160_sha256(rmd160,databuf,datalen);
iguana_pushdata(stacks,0,rmd160,sizeof(rmd160));
break;
case IGUANA_OP_SHA256:

6
iguana/iguana_sign.c

@ -492,9 +492,9 @@ bits256 bitcoin_sigtxid(struct iguana_info *coin,int32_t height,uint8_t *seriali
{
dest.vins[i].vinscript = spendscript;
dest.vins[i].scriptlen = spendlen;
//int32_t j; for (j=0; j<spendlen; j++)
// printf("%02x",spendscript[j]);
//printf(" tmpscript.%d vini.%d\n",spendlen,vini);
int32_t j; for (j=0; j<spendlen; j++)
printf("%02x",spendscript[j]);
printf(" tmpscript.%d vini.%d\n",spendlen,vini);
}
else
{

Loading…
Cancel
Save