|
|
@ -475,8 +475,6 @@ int32_t basilisk_verify_bobdeposit(struct supernet_info *myinfo,void *ptr,uint8_ |
|
|
|
uint8_t userdata[512]; int32_t retval,len = 0; static bits256 zero; struct basilisk_swap *swap = ptr; |
|
|
|
if ( basilisk_rawtx_spendscript(myinfo,swap,swap->bobcoin->blocks.hwmchain.height,&swap->bobdeposit,0,data,datalen,0) == 0 ) |
|
|
|
{ |
|
|
|
//userdata[len++] = 0x51;
|
|
|
|
//basilisk_bobscripts_set(myinfo,swap,1,0);
|
|
|
|
len = basilisk_swapuserdata(swap,userdata,zero,1,swap->myprivs[0],swap->bobdeposit.redeemscript,swap->bobdeposit.redeemlen); |
|
|
|
if ( (retval= basilisk_rawtx_sign(myinfo,swap->bobcoin->blocks.hwmchain.height,swap,&swap->aliceclaim,&swap->bobdeposit,swap->myprivs[0],0,userdata,len)) == 0 ) |
|
|
|
{ |
|
|
@ -515,7 +513,6 @@ int32_t basilisk_bobpayment_reclaim(struct supernet_info *myinfo,struct basilisk |
|
|
|
uint8_t userdata[512]; int32_t retval,len = 0; static bits256 zero; |
|
|
|
printf("basilisk_bobpayment_reclaim\n"); |
|
|
|
len = basilisk_swapuserdata(swap,userdata,zero,1,swap->myprivs[1],swap->bobpayment.redeemscript,swap->bobpayment.redeemlen); |
|
|
|
//userdata[len++] = 0x51;
|
|
|
|
if ( (retval= basilisk_rawtx_sign(myinfo,swap->bobcoin->blocks.hwmchain.height,swap,&swap->bobreclaim,&swap->bobpayment,swap->myprivs[1],0,userdata,len)) == 0 ) |
|
|
|
{ |
|
|
|
basilisk_txlog(myinfo,swap,&swap->bobreclaim,delay); |
|
|
@ -526,12 +523,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) |
|
|
|
{ |
|
|
|
uint8_t userdata[512]; int32_t i,retval,len = 0; struct basilisk_swap *swap = ptr; |
|
|
|
uint8_t userdata[512]; int32_t i,retval,len = 0; bits256 revAm; struct basilisk_swap *swap = ptr; |
|
|
|
if ( basilisk_rawtx_spendscript(myinfo,swap,swap->bobcoin->blocks.hwmchain.height,&swap->bobpayment,0,data,datalen,0) == 0 ) |
|
|
|
{ |
|
|
|
//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); |
|
|
|
for (i=0; i<32; 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); |
|
|
|
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 ) |
|
|
|
{ |
|
|
|