jl777 8 years ago
parent
commit
ac6d09b0d0
  1. 6
      basilisk/basilisk_swap.c
  2. 6
      iguana/iguana_sign.c
  3. 6
      iguana/iguana_unspents.c

6
basilisk/basilisk_swap.c

@ -403,7 +403,7 @@ int32_t basilisk_verify_bobdeposit(struct supernet_info *myinfo,void *ptr,uint8_
int32_t basilisk_bobdeposit_refund(struct supernet_info *myinfo,struct basilisk_swap *swap)
{
uint8_t userdata[512],revrmd160[20]; int32_t len = 0;
uint8_t userdata[512],revrmd160[20],testpub[33]; int32_t len = 0;
len = basilisk_swapuserdata(userdata,1,swap->privBn,0x03,swap->pubB0,0,1);
int32_t i; for (i=0; i<len; i++)
printf("%02x",userdata[i]);
@ -412,6 +412,10 @@ int32_t basilisk_bobdeposit_refund(struct supernet_info *myinfo,struct basilisk_
for (i=0; i<20; i++)
printf("%02x",revrmd160[i]);
printf(" <- revrmd160\n");
bitcoin_pubkey33(myinfo->ctx,testpub,swap->myprivs[0]);
if ( memcmp(swap->pubB0.bytes,testpub+1,32) == 0 )
printf("VERIFIED priv -> pub\n");
else printf("ERROR priv -> pub\n");
return(basilisk_rawtx_sign(myinfo,swap->bobcoin->blocks.hwmchain.height,swap,&swap->bobrefund,&swap->bobdeposit,swap->myprivs[0],0,userdata,len));
}

6
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,i,scriptlen,activescriptlen,errs = 0; cJSON *spendscript,*item;
uint8_t script[IGUANA_MAXSCRIPTSIZE],*activescript; char str[IGUANA_MAXSCRIPTSIZE*2+1]; int32_t vini,scriptlen,activescriptlen,errs = 0; cJSON *spendscript,*item;
for (vini=0; vini<numvins; vini++)
{
if ( V[vini].p2shlen > 0 )
@ -1276,8 +1276,6 @@ 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<V[vini].spendlen; i++)
printf("%02x",V[vini].spendscript[i]);
if ( logarray != 0 )
{
item = cJSON_CreateObject();
@ -1287,7 +1285,7 @@ int32_t iguana_interpreter(struct iguana_info *coin,cJSON *logarray,int64_t nLoc
init_hexbytes_noT(str,script,scriptlen);
jaddstr(item,"reconstructed",str);
jaddi(logarray,item);
} else printf(" scriptlen mismatch.%d vs %d or miscompare\n",scriptlen,V[vini].spendlen);
} else printf(" scriptlen mismatch.%d vs %d or miscompare\n",scriptlen,activescriptlen);
errs++;
}
}

6
iguana/iguana_unspents.c

@ -839,7 +839,13 @@ int32_t iguana_staker_sort(struct iguana_info *coin,bits256 *hash2p,uint8_t *ref
int32_t iguana_markedunspents_find(struct iguana_info *coin,int32_t *firstslotp,bits256 txid,int32_t vout)
{
static int32_t didinit;
int32_t i; //char str[65];
if ( didinit == 0 )
{
printf("Load recent unspents here!\n");
didinit = 1;
}
*firstslotp = -1;
if ( bits256_nonz(txid) != 0 && vout >= 0 )
{

Loading…
Cancel
Save