Browse Source

Test

etomic
jl777 8 years ago
parent
commit
3b95bcd971
  1. 7
      basilisk/basilisk_swap.c
  2. 2
      iguana/iguana777.h
  3. 1
      iguana/unparsed.txt

7
basilisk/basilisk_swap.c

@ -955,9 +955,9 @@ int32_t basilisk_swapget(struct supernet_info *myinfo,struct basilisk_swap *swap
} }
for (i=0; i<swap->nummessages; i++) for (i=0; i<swap->nummessages; i++)
{ {
if ( swap->messages[i].msgbits == msgbits ) if ( swap->messages[i].msgbits == msgbits && bits256_cmp(swap->messages[i].desthash,swap->persistent_pubkey) == 0 )
{ {
printf("matched %x datalen.%d\n",msgbits,swap->messages[i].datalen); //printf("matched %x datalen.%d\n",msgbits,swap->messages[i].datalen);
retval = (*basilisk_verify_func)(myinfo,swap,swap->messages[i].data,swap->messages[i].datalen); retval = (*basilisk_verify_func)(myinfo,swap,swap->messages[i].data,swap->messages[i].datalen);
break; break;
} }
@ -1895,6 +1895,7 @@ void basilisk_psockinit(struct supernet_info *myinfo,struct basilisk_swap *swap,
} }
else else
{ {
printf("connected.%d\n",swap->connected);
if ( (retstr= _dex_kvsearch(myinfo,"KV",keystr)) != 0 ) if ( (retstr= _dex_kvsearch(myinfo,"KV",keystr)) != 0 )
{ {
if ( (retjson= cJSON_Parse(retstr)) != 0 ) if ( (retjson= cJSON_Parse(retstr)) != 0 )
@ -1918,7 +1919,7 @@ void basilisk_psockinit(struct supernet_info *myinfo,struct basilisk_swap *swap,
} }
free_json(retjson); free_json(retjson);
} }
printf("KVsearch.(%s)\n",retstr); printf("KVsearch.(%s) connected.%d\n",retstr,swap->connected);
free(retstr); free(retstr);
} }
} }

2
iguana/iguana777.h

@ -169,11 +169,11 @@ struct basilisk_swap
{ {
struct supernet_info *myinfoptr; struct iguana_info *bobcoin,*alicecoin; struct supernet_info *myinfoptr; struct iguana_info *bobcoin,*alicecoin;
void (*balancingtrade)(struct supernet_info *myinfo,struct basilisk_swap *swap,int32_t iambob); void (*balancingtrade)(struct supernet_info *myinfo,struct basilisk_swap *swap,int32_t iambob);
int32_t subsock,pushsock,connected;
bits256 persistent_privkey,persistent_pubkey; bits256 persistent_privkey,persistent_pubkey;
struct basilisk_swapinfo I; struct basilisk_swapinfo I;
struct basilisk_rawtx bobdeposit,bobpayment,alicepayment,myfee,otherfee,aliceclaim,alicespend,bobreclaim,bobspend,bobrefund,alicereclaim; struct basilisk_rawtx bobdeposit,bobpayment,alicepayment,myfee,otherfee,aliceclaim,alicespend,bobreclaim,bobspend,bobrefund,alicereclaim;
bits256 privkeys[INSTANTDEX_DECKSIZE]; bits256 privkeys[INSTANTDEX_DECKSIZE];
int32_t subsock,pushsock,connected;
struct basilisk_swapmessage *messages; int32_t nummessages; 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]; uint8_t persistent_pubkey33[33],pad[15],verifybuf[65536];

1
iguana/unparsed.txt

@ -0,0 +1 @@
6304a16dbc58b1752102baf994f2e1e765f474a3fd8c46f6b13c518e8855858ab46c69008c91ee84cda2ac67a914eed7fe456f91215de2205098928052bd8dbda9c6882103baf994f2e1e765f474a3fd8c46f6b13c518e8855858ab46c69008c91ee84cda2ac68
Loading…
Cancel
Save