Browse Source

Test

etomic
jl777 8 years ago
parent
commit
27d6452bf5
  1. 2
      iguana/exchanges/LP_commands.c
  2. 2
      iguana/exchanges/LP_nativeDEX.c
  3. 5
      iguana/exchanges/LP_utxos.c

2
iguana/exchanges/LP_commands.c

@ -305,7 +305,7 @@ trust(pubkey, trust)\n\
return(LP_utxos(1,LP_mypeer,jstr(argjson,"coin"),jint(argjson,"lastn"))); return(LP_utxos(1,LP_mypeer,jstr(argjson,"coin"),jint(argjson,"lastn")));
else if ( strcmp(method,"utxo") == 0 ) else if ( strcmp(method,"utxo") == 0 )
{ {
printf("UTXO.%s\n",method); //printf("UTXO.%s\n",method);
if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 ) if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 )
retstr = clonestr("{\"result\":\"success\",\"utxo\":\"received\"}"); retstr = clonestr("{\"result\":\"success\",\"utxo\":\"received\"}");
else retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); else retstr = clonestr("{\"result\":\"couldnt add utxo\"}");

2
iguana/exchanges/LP_nativeDEX.c

@ -154,7 +154,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock,
if ( duplicate != 0 ) if ( duplicate != 0 )
dup++; dup++;
else uniq++; else uniq++;
printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff); printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x U.%d\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff,LP_mypeer != 0 ? LP_mypeer->numutxos : -1);
if ( duplicate == 0 ) if ( duplicate == 0 )
{ {
LP_crc32find(&duplicate,i,crc32); LP_crc32find(&duplicate,i,crc32);

5
iguana/exchanges/LP_utxos.c

@ -602,6 +602,8 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit
portable_mutex_unlock(&LP_utxomutex); portable_mutex_unlock(&LP_utxomutex);
if ( iambob != 0 ) if ( iambob != 0 )
{ {
if ( LP_mypeer != 0 )
LP_mypeer->numutxos++;
/*if ( mypubsock >= 0 ) /*if ( mypubsock >= 0 )
{ {
msg = jprint(LP_utxojson(utxo),1); msg = jprint(LP_utxojson(utxo),1);
@ -611,10 +613,7 @@ struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bit
{ {
LP_utxo_clientpublish(utxo); LP_utxo_clientpublish(utxo);
if ( LP_mypeer != 0 ) if ( LP_mypeer != 0 )
{
LP_mypeer->numutxos++;
utxo->T.lasttime = (uint32_t)time(NULL); utxo->T.lasttime = (uint32_t)time(NULL);
}
} }
} }
return(utxo); return(utxo);

Loading…
Cancel
Save