jl777 8 years ago
parent
commit
912636dae4
  1. 11
      basilisk/basilisk_swap.c
  2. 1
      gecko/gecko_mempool.c
  3. 7
      iguana/iguana_sign.c
  4. 2
      iguana/iguana_unspents.c

11
basilisk/basilisk_swap.c

@ -719,7 +719,7 @@ int32_t basilisk_rawtx_gen(char *str,struct supernet_info *myinfo,int32_t iambob
printf("%s locktime.%u\n",rawtx->name,locktime); printf("%s locktime.%u\n",rawtx->name,locktime);
if ( (retstr= basilisk_bitcoinrawtx(myinfo,rawtx->coin,"",basilisktag,jint(valsobj,"timeout"),valsobj)) != 0 ) if ( (retstr= basilisk_bitcoinrawtx(myinfo,rawtx->coin,"",basilisktag,jint(valsobj,"timeout"),valsobj)) != 0 )
{ {
printf("%s got.(%s)\n",str,retstr); printf("%s %s basilisk_bitcoinrawtx.(%s)\n",rawtx->name,str,retstr);
flag = 0; flag = 0;
if ( (retarray= cJSON_Parse(retstr)) != 0 ) if ( (retarray= cJSON_Parse(retstr)) != 0 )
{ {
@ -738,7 +738,6 @@ int32_t basilisk_rawtx_gen(char *str,struct supernet_info *myinfo,int32_t iambob
} else printf("error creating %s feetx\n",iambob != 0 ? "BOB" : "ALICE"); } else printf("error creating %s feetx\n",iambob != 0 ? "BOB" : "ALICE");
free_json(privkeyarray); free_json(privkeyarray);
free_json(valsobj); free_json(valsobj);
printf("rawtx retval.%d\n",retval);
return(retval); return(retval);
} }
@ -1059,7 +1058,7 @@ void basilisk_sendpubkeys(struct supernet_info *myinfo,struct basilisk_swap *swa
{ {
int32_t datalen; int32_t datalen;
datalen = basilisk_swapdata_deck(myinfo,swap,data,maxlen); datalen = basilisk_swapdata_deck(myinfo,swap,data,maxlen);
printf("send deck.%d\n",datalen); //printf("send deck.%d\n",datalen);
swap->statebits |= basilisk_swapsend(myinfo,swap,0x02,data,datalen,0x01,swap->crcs_mypub); swap->statebits |= basilisk_swapsend(myinfo,swap,0x02,data,datalen,0x01,swap->crcs_mypub);
} }
@ -1067,7 +1066,7 @@ int32_t basilisk_checkdeck(struct supernet_info *myinfo,struct basilisk_swap *sw
{ {
if ( (swap->statebits & 0x02) == 0 ) if ( (swap->statebits & 0x02) == 0 )
{ {
printf("check for other deck\n"); //printf("check for other deck\n");
if ( basilisk_swapget(myinfo,swap,0x02,data,maxlen,basilisk_verify_otherdeck) == 0 ) if ( basilisk_swapget(myinfo,swap,0x02,data,maxlen,basilisk_verify_otherdeck) == 0 )
swap->statebits |= 0x02; swap->statebits |= 0x02;
else return(-1); else return(-1);
@ -1108,7 +1107,7 @@ void basilisk_sendchoosei(struct supernet_info *myinfo,struct basilisk_swap *swa
void basilisk_waitchoosei(struct supernet_info *myinfo,struct basilisk_swap *swap,uint8_t *data,int32_t maxlen) void basilisk_waitchoosei(struct supernet_info *myinfo,struct basilisk_swap *swap,uint8_t *data,int32_t maxlen)
{ {
uint8_t pubkey33[33]; char str[65]; uint8_t pubkey33[33]; char str[65];
printf("check otherchoosei\n"); //printf("check otherchoosei\n");
if ( basilisk_swapget(myinfo,swap,0x08,data,maxlen,basilisk_verify_choosei) == 0 ) if ( basilisk_swapget(myinfo,swap,0x08,data,maxlen,basilisk_verify_choosei) == 0 )
{ {
if ( swap->iambob != 0 ) if ( swap->iambob != 0 )
@ -1160,7 +1159,7 @@ void basilisk_sendmostprivs(struct supernet_info *myinfo,struct basilisk_swap *s
for (i=0; i<20; i++) for (i=0; i<20; i++)
data[datalen++] = swap->secretAm[i]; data[datalen++] = swap->secretAm[i];
} }
printf("send privkeys.%d\n",datalen); //printf("send privkeys.%d\n",datalen);
swap->statebits |= basilisk_swapsend(myinfo,swap,0x20,data,datalen,0x10,swap->crcs_myprivs); swap->statebits |= basilisk_swapsend(myinfo,swap,0x20,data,datalen,0x10,swap->crcs_myprivs);
} }

1
gecko/gecko_mempool.c

@ -239,6 +239,7 @@ char *gecko_txarrived(struct supernet_info *myinfo,struct iguana_info *virt,char
{ {
if ( iguana_RTunspentindfind(myinfo,virt,&outpt,0,0,0,&value,&spentheight,msg.vins[i].prev_hash,msg.vins[i].prev_vout,virt->bundlescount-1,1) == 0 ) if ( iguana_RTunspentindfind(myinfo,virt,&outpt,0,0,0,&value,&spentheight,msg.vins[i].prev_hash,msg.vins[i].prev_vout,virt->bundlescount-1,1) == 0 )
{ {
printf("gecko txarrived\n");
if ( iguana_unspentavail(myinfo,virt,outpt,minconf,maxconf) != value ) if ( iguana_unspentavail(myinfo,virt,outpt,minconf,maxconf) != value )
{ {
printf("vin.%d already spent\n",i); printf("vin.%d already spent\n",i);

7
iguana/iguana_sign.c

@ -759,7 +759,12 @@ cJSON *bitcoin_data2json(struct iguana_info *coin,int32_t height,bits256 *txidp,
jaddstr(txobj,"coin",coin->symbol); jaddstr(txobj,"coin",coin->symbol);
} }
if ( n != len ) if ( n != len )
printf("data2json n.%d vs len.%d\n",n,len); {
int32_t i;
for (i=0; i<=len; i++)
printf("%02x",serialized[i]);
printf(" data2json n.%d vs len.%d\n",n,len);
}
return(txobj); return(txobj);
} }

2
iguana/iguana_unspents.c

@ -970,7 +970,7 @@ uint64_t iguana_unspentavail(struct supernet_info *myinfo,struct iguana_info *co
} }
else else
{ {
printf("%s illegal unspentind.%u vs %u [%d]\n",coin->symbol,outpt.unspentind,rdata->numunspents,bp->hdrsi); printf("%s illegal unspentind.%u [%d] vs %u [%d]\n",coin->symbol,outpt.unspentind,outpt.hdrsi,rdata->numunspents,bp->hdrsi);
return(-2); return(-2);
} }
} }

Loading…
Cancel
Save