Browse Source

Test

etomic
jl777 7 years ago
parent
commit
04c16d6a95
  1. 4
      crypto777/OS_portable.c
  2. 8
      iguana/exchanges/LP_nativeDEX.c
  3. 4
      iguana/exchanges/LP_scan.c
  4. 8
      iguana/exchanges/LP_swap.c
  5. 4
      iguana/exchanges/LP_transaction.c

4
crypto777/OS_portable.c

@ -249,13 +249,13 @@ void *OS_portable_tmpalloc(char *dirname,char *name,struct OS_memspace *mem,long
if ( mem->totalsize > origsize ) if ( mem->totalsize > origsize )
size = mem->totalsize; size = mem->totalsize;
else size = origsize; else size = origsize;
fprintf(stderr,"filealloc.(%s) -> ",fname); printf("filealloc.(%s) -> ",fname);
if ( OS_filealloc(&mem->M,fname,mem,size) == 0 ) if ( OS_filealloc(&mem->M,fname,mem,size) == 0 )
{ {
printf("couldnt map tmpfile %s\n",fname); printf("couldnt map tmpfile %s\n",fname);
return(0); return(0);
} }
fprintf(stderr,"created\n"); printf("created\n");
} }
ptr = iguana_memalloc(mem,origsize,1); ptr = iguana_memalloc(mem,origsize,1);
if ( mem->threadsafe != 0 ) if ( mem->threadsafe != 0 )

8
iguana/exchanges/LP_nativeDEX.c

@ -669,7 +669,7 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins)
int32_t i,n; cJSON *item; int32_t i,n; cJSON *item;
for (i=0; i<sizeof(activecoins)/sizeof(*activecoins); i++) for (i=0; i<sizeof(activecoins)/sizeof(*activecoins); i++)
{ {
fprintf(stderr,"%s ",activecoins[i]); printf("%s ",activecoins[i]);
LP_coinfind(activecoins[i]); LP_coinfind(activecoins[i]);
LP_priceinfoadd(activecoins[i]); LP_priceinfoadd(activecoins[i]);
} }
@ -678,12 +678,12 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins)
for (i=0; i<n; i++) for (i=0; i<n; i++)
{ {
item = jitem(coins,i); item = jitem(coins,i);
fprintf(stderr,"%s ",jstr(item,"coin")); printf("%s ",jstr(item,"coin"));
LP_coincreate(item); LP_coincreate(item);
LP_priceinfoadd(jstr(item,"coin")); LP_priceinfoadd(jstr(item,"coin"));
} }
} }
fprintf(stderr,"privkey updates\n"); printf("privkey updates\n");
} }
void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint16_t myport,char *seednode) void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint16_t myport,char *seednode)
@ -1025,7 +1025,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu
G.waiting = 1; G.waiting = 1;
while ( G.initializing != 0 ) while ( G.initializing != 0 )
{ {
fprintf(stderr,"."); //fprintf(stderr,".");
sleep(3); sleep(3);
} }
if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 ) if ( LP_mainloop_iter(ctx,myipaddr,mypeer,pubsock,pushaddr,myport) != 0 )

4
iguana/exchanges/LP_scan.c

@ -68,7 +68,7 @@ int32_t LP_scanblockchain(struct iguana_info *coin,int32_t startheight,int32_t e
} }
n++; n++;
if ( (n % 1000) == 0 ) if ( (n % 1000) == 0 )
fprintf(stderr,"%.1f%% ",100. * (double)n/(endheight-startheight+1)); printf("%.1f%% ",100. * (double)n/(endheight-startheight+1));
} }
return(endheight); return(endheight);
} }
@ -100,7 +100,7 @@ int32_t komodo_bannedset(int32_t *indallvoutsp,bits256 *array,int32_t max)
int32_t i; int32_t i;
if ( sizeof(banned_txids)/sizeof(*banned_txids) > max ) if ( sizeof(banned_txids)/sizeof(*banned_txids) > max )
{ {
fprintf(stderr,"komodo_bannedset: buffer too small %ld vs %d\n",(long)sizeof(banned_txids)/sizeof(*banned_txids),max); printf("komodo_bannedset: buffer too small %ld vs %d\n",(long)sizeof(banned_txids)/sizeof(*banned_txids),max);
exit(-1); exit(-1);
} }
for (i=0; i<sizeof(banned_txids)/sizeof(*banned_txids); i++) for (i=0; i<sizeof(banned_txids)/sizeof(*banned_txids); i++)

8
iguana/exchanges/LP_swap.c

@ -747,7 +747,7 @@ void LP_bobloop(void *_swap)
{ {
uint8_t *data; int32_t maxlen,m,n; uint32_t expiration; struct basilisk_swap *swap = _swap; uint8_t *data; int32_t maxlen,m,n; uint32_t expiration; struct basilisk_swap *swap = _swap;
G.LP_pendingswaps++; G.LP_pendingswaps++;
fprintf(stderr,"start swap iambob\n"); printf("start swap iambob\n");
maxlen = 1024*1024 + sizeof(*swap); maxlen = 1024*1024 + sizeof(*swap);
data = malloc(maxlen); data = malloc(maxlen);
expiration = (uint32_t)time(NULL) + LP_SWAPSTEP_TIMEOUT; expiration = (uint32_t)time(NULL) + LP_SWAPSTEP_TIMEOUT;
@ -817,7 +817,7 @@ void LP_aliceloop(void *_swap)
expiration = (uint32_t)time(NULL) + LP_SWAPSTEP_TIMEOUT; expiration = (uint32_t)time(NULL) + LP_SWAPSTEP_TIMEOUT;
if ( swap != 0 ) if ( swap != 0 )
{ {
fprintf(stderr,"start swap iamalice pair.%d\n",swap->N.pair); printf("start swap iamalice pair.%d\n",swap->N.pair);
if ( LP_sendwait("pubkeys",60,swap->N.pair,swap,data,maxlen,LP_pubkeys_verify,LP_pubkeys_data) < 0 ) if ( LP_sendwait("pubkeys",60,swap->N.pair,swap,data,maxlen,LP_pubkeys_verify,LP_pubkeys_data) < 0 )
printf("error LP_sendwait pubkeys\n"); printf("error LP_sendwait pubkeys\n");
else if ( LP_sendwait("choosei",LP_SWAPSTEP_TIMEOUT,swap->N.pair,swap,data,maxlen,LP_choosei_verify,LP_choosei_data) < 0 ) else if ( LP_sendwait("choosei",LP_SWAPSTEP_TIMEOUT,swap->N.pair,swap,data,maxlen,LP_choosei_verify,LP_choosei_data) < 0 )
@ -910,12 +910,12 @@ int32_t instantdex_pubkeyargs(struct basilisk_swap *swap,int32_t numpubs,bits256
{ {
if ( swap->I.numpubs+2 >= numpubs ) if ( swap->I.numpubs+2 >= numpubs )
return(numpubs); return(numpubs);
//fprintf(stderr,">>>>>> start generating %s\n",buf); //printf(">>>>>> start generating %s\n",buf);
} }
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->ctx,&privkey,pubkey,privkey,hash); pubi = instantdex_derivekeypair(swap->ctx,&privkey,pubkey,privkey,hash);
//fprintf(stderr,"i.%d n.%d numpubs.%d %02x vs %02x\n",i,n,numpubs,pubkey[0],firstbyte); //printf("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 )

4
iguana/exchanges/LP_transaction.c

@ -490,7 +490,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_
if ( (txobj= bitcoin_hex2json(taddr,pubtype,p2shtype,isPoS,height,&txid,msgtx,rawtx,extraspace,extralen,serialized4,vins,V->suppress_pubkeys,zcash)) != 0 ) if ( (txobj= bitcoin_hex2json(taddr,pubtype,p2shtype,isPoS,height,&txid,msgtx,rawtx,extraspace,extralen,serialized4,vins,V->suppress_pubkeys,zcash)) != 0 )
{ {
//printf("back from bitcoin_hex2json (%s)\n",jprint(vins,0)); //printf("back from bitcoin_hex2json (%s)\n",jprint(vins,0));
} else fprintf(stderr,"no txobj from bitcoin_hex2json\n"); } else printf("no txobj from bitcoin_hex2json\n");
//printf("call hex2json.(%s) vins.(%s)\n",rawtx,jprint(vins,0)); //printf("call hex2json.(%s) vins.(%s)\n",rawtx,jprint(vins,0));
if ( (numinputs= cJSON_GetArraySize(vins)) > 0 ) if ( (numinputs= cJSON_GetArraySize(vins)) > 0 )
{ {
@ -593,7 +593,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_
} else printf("interpreter passed\n");*/ } else printf("interpreter passed\n");*/
} else printf("complete.%d\n",complete); } else printf("complete.%d\n",complete);
} else printf("rwmsgtx error\n"); } else printf("rwmsgtx error\n");
} else fprintf(stderr,"no inputs in vins.(%s)\n",vins!=0?jprint(vins,0):"null"); } else printf("no inputs in vins.(%s)\n",vins!=0?jprint(vins,0):"null");
free(extraspace); free(extraspace);
free(serialized), free(serialized2), free(serialized3), free(serialized4); free(serialized), free(serialized2), free(serialized3), free(serialized4);
} else return(-1); } else return(-1);

Loading…
Cancel
Save