Browse Source

Test

etomic
jl777 8 years ago
parent
commit
4828910d4a
  1. 2
      .gitignore
  2. 6
      basilisk/basilisk_swap.c
  3. 7
      iguana/iguana777.h

2
.gitignore

@ -174,3 +174,5 @@ iguana/DB/SWAPS/.tmpmarker
iguana/DB/SWAPS/list iguana/DB/SWAPS/list
iguana/DB/SWAPS/15974209-4014252807 iguana/DB/SWAPS/15974209-4014252807
iguana/iguana777.o-0cc60f50

6
basilisk/basilisk_swap.c

@ -1235,7 +1235,7 @@ int32_t instantdex_pubkeyargs(void *ctx,struct basilisk_swap *swap,int32_t numpu
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(ctx,&privkey,pubkey,privkey,hash); pubi = instantdex_derivekeypair(ctx,&privkey,pubkey,privkey,hash);
fprintf(stderr,"i.%d n.%d numpubs.%d %02x vs %02x\n",i,n,numpubs,pubkey[0],firstbyte); //fprintf(stderr,"i.%d n.%d numpubs.%d %02x vs %02x\n",i,n,numpubs,pubkey[0],firstbyte);
if ( pubkey[0] != firstbyte ) if ( pubkey[0] != firstbyte )
continue; continue;
if ( n < 2 ) if ( n < 2 )
@ -1378,9 +1378,13 @@ struct basilisk_swap *bitcoin_swapinit(struct supernet_info *myinfo,bits256 priv
swap->I.aliceinsurance = 10000; swap->I.aliceinsurance = 10000;
fprintf(stderr,"D\n"); fprintf(stderr,"D\n");
strcpy(swap->I.bobstr,swap->bobcoin->symbol); strcpy(swap->I.bobstr,swap->bobcoin->symbol);
fprintf(stderr,"D2\n");
strcpy(swap->I.alicestr,swap->alicecoin->symbol); strcpy(swap->I.alicestr,swap->alicecoin->symbol);
fprintf(stderr,"D3\n");
swap->I.started = (uint32_t)time(NULL); swap->I.started = (uint32_t)time(NULL);
fprintf(stderr,"D4\n");
swap->I.expiration = swap->I.req.timestamp + swap->I.putduration + swap->I.callduration; swap->I.expiration = swap->I.req.timestamp + swap->I.putduration + swap->I.callduration;
fprintf(stderr,"D5\n");
OS_randombytes((uint8_t *)&swap->I.choosei,sizeof(swap->I.choosei)); OS_randombytes((uint8_t *)&swap->I.choosei,sizeof(swap->I.choosei));
if ( swap->I.choosei < 0 ) if ( swap->I.choosei < 0 )
swap->I.choosei = -swap->I.choosei; swap->I.choosei = -swap->I.choosei;

7
iguana/iguana777.h

@ -180,12 +180,13 @@ struct basilisk_swap
int32_t subsock,pushsock,connected; int32_t subsock,pushsock,connected;
FILE *fp; FILE *fp;
bits256 persistent_privkey,persistent_pubkey; bits256 persistent_privkey,persistent_pubkey;
struct basilisk_swapmessage *messages; int32_t nummessages;
uint8_t persistent_pubkey33[33],pad[15],verifybuf[65536];
struct basilisk_rawtx bobdeposit,bobpayment,alicepayment,myfee,otherfee,aliceclaim,alicespend,bobreclaim,bobspend,bobrefund,alicereclaim;
struct basilisk_swapinfo I; struct basilisk_swapinfo I;
struct basilisk_rawtx bobdeposit,bobpayment,alicepayment,myfee,otherfee,aliceclaim,alicespend,bobreclaim,bobspend,bobrefund,alicereclaim;
bits256 privkeys[INSTANTDEX_DECKSIZE]; bits256 privkeys[INSTANTDEX_DECKSIZE];
struct basilisk_swapmessage *messages; int32_t nummessages;
uint64_t otherdeck[INSTANTDEX_DECKSIZE][2],deck[INSTANTDEX_DECKSIZE][2]; uint64_t otherdeck[INSTANTDEX_DECKSIZE][2],deck[INSTANTDEX_DECKSIZE][2];
uint8_t persistent_pubkey33[33],pad[15],verifybuf[65536];
}; };
#include "../includes/iguana_funcs.h" #include "../includes/iguana_funcs.h"

Loading…
Cancel
Save