Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
ad4c838175
  1. 2
      iguana/iguana_instantdex.c
  2. 6
      iguana/swaps/iguana_BTCswap.c

2
iguana/iguana_instantdex.c

@ -917,7 +917,7 @@ char *instantdex_checkoffer(struct supernet_info *myinfo,uint64_t *txidp,struct
isbob = myap->offer.myside; isbob = myap->offer.myside;
swap = bitcoin_swapinit(myinfo,exchange,myap,otherap,1,argjson,isbob != 0 ? "BOB_sentoffer" : "ALICE_sentoffer"); swap = bitcoin_swapinit(myinfo,exchange,myap,otherap,1,argjson,isbob != 0 ? "BOB_sentoffer" : "ALICE_sentoffer");
printf("STATEMACHINEQ.(%llu / %llu)\n",(long long)swap->mine.orderid,(long long)swap->other.orderid); printf("STATEMACHINEQ.(%llu / %llu)\n",(long long)swap->mine.orderid,(long long)swap->other.orderid);
queue_enqueue("acceptableQ",&exchange->acceptableQ,&swap->DL,0); //queue_enqueue("acceptableQ",&exchange->acceptableQ,&swap->DL,0);
queue_enqueue("statemachineQ",&exchange->statemachineQ,&swap->DL,0); queue_enqueue("statemachineQ",&exchange->statemachineQ,&swap->DL,0);
if ( (newjson= instantdex_parseargjson(myinfo,exchange,swap,argjson,1)) == 0 ) if ( (newjson= instantdex_parseargjson(myinfo,exchange,swap,argjson,1)) == 0 )
return(clonestr("{\"error\":\"instantdex_checkoffer null newjson\"}")); return(clonestr("{\"error\":\"instantdex_checkoffer null newjson\"}"));

6
iguana/swaps/iguana_BTCswap.c

@ -387,6 +387,7 @@ int32_t instantdex_pubkeyargs(struct bitcoin_swapinfo *swap,cJSON *newjson,int32
{ {
char buf[3]; int32_t i,n,m,len=0; bits256 pubi; uint64_t txid; uint8_t secret160[20],pubkey[33]; char buf[3]; int32_t i,n,m,len=0; bits256 pubi; uint64_t txid; uint8_t secret160[20],pubkey[33];
sprintf(buf,"%c0",'A' - 0x02 + firstbyte); sprintf(buf,"%c0",'A' - 0x02 + firstbyte);
printf(">>>>>> start generating\n");
for (i=n=m=0; i<numpubs*100 && n<numpubs; i++) for (i=n=m=0; i<numpubs*100 && n<numpubs; i++)
{ {
pubi = instantdex_derivekeypair(&swap->privkeys[n],pubkey,privkey,hash); pubi = instantdex_derivekeypair(&swap->privkeys[n],pubkey,privkey,hash);
@ -404,18 +405,19 @@ int32_t instantdex_pubkeyargs(struct bitcoin_swapinfo *swap,cJSON *newjson,int32
{ {
calc_rmd160_sha256(secret160,swap->privkeys[n].bytes,sizeof(swap->privkeys[n])); calc_rmd160_sha256(secret160,swap->privkeys[n].bytes,sizeof(swap->privkeys[n]));
memcpy(&txid,secret160,sizeof(txid)); memcpy(&txid,secret160,sizeof(txid));
txid = (m+1) | ((m+1)<<16); /*txid = (m+1) | ((m+1)<<16);
txid <<= 32; txid <<= 32;
txid = (m+1) | ((m+1)<<16); txid = (m+1) | ((m+1)<<16);
pubi.txid = (m+1) | ((m+1)<<16); pubi.txid = (m+1) | ((m+1)<<16);
pubi.txid <<= 32; pubi.txid <<= 32;
pubi.txid = (m+1) | ((m+1)<<16); pubi.txid = (m+1) | ((m+1)<<16);*/
len += iguana_rwnum(1,(uint8_t *)&swap->deck[m][0],sizeof(txid),&txid); len += iguana_rwnum(1,(uint8_t *)&swap->deck[m][0],sizeof(txid),&txid);
len += iguana_rwnum(1,(uint8_t *)&swap->deck[m][1],sizeof(pubi.txid),&pubi.txid); len += iguana_rwnum(1,(uint8_t *)&swap->deck[m][1],sizeof(pubi.txid),&pubi.txid);
m++; m++;
} }
n++; n++;
} }
printf("n.%d m.%d len.%d\n",n,m,len);
return(n); return(n);
} }

Loading…
Cancel
Save