jl777 8 years ago
parent
commit
226080c3cf
  1. 10
      basilisk/basilisk_swap.c

10
basilisk/basilisk_swap.c

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

Loading…
Cancel
Save