Browse Source

Test

etomic
jl777 7 years ago
parent
commit
59a85be27b
  1. 3
      iguana/exchanges/LP_forwarding.c
  2. 2
      iguana/exchanges/LP_nativeDEX.c
  3. 1
      iguana/exchanges/LP_utxos.c

3
iguana/exchanges/LP_forwarding.c

@ -200,6 +200,7 @@ int32_t LP_forward(char *myipaddr,int32_t pubsock,double profitmargin,bits256 pu
} }
else if ( IAMLP != 0 && (ptr= LP_forwardfind(pubkey)) != 0 && ptr->pushsock >= 0 && ptr->lasttime > time(NULL)-LP_KEEPALIVE ) else if ( IAMLP != 0 && (ptr= LP_forwardfind(pubkey)) != 0 && ptr->pushsock >= 0 && ptr->lasttime > time(NULL)-LP_KEEPALIVE )
{ {
printf("GOT FORWARDED.(%s)\n",jsonstr);
return(LP_send(ptr->pushsock,jsonstr,1)); return(LP_send(ptr->pushsock,jsonstr,1));
} }
} }
@ -220,7 +221,7 @@ int32_t LP_forward(char *myipaddr,int32_t pubsock,double profitmargin,bits256 pu
} else retval = 0; } else retval = 0;
if ( retval >= 0 && peer->pushsock >= 0 ) if ( retval >= 0 && peer->pushsock >= 0 )
{ {
//printf("found LPnode.(%s) forward.(%s)\n",peer->ipaddr,jsonstr); printf("found LPnode.(%s) forward.(%s)\n",peer->ipaddr,jsonstr);
len = (int32_t)strlen(jsonstr) + 1; len = (int32_t)strlen(jsonstr) + 1;
hexstr = malloc(len*2 + 1); hexstr = malloc(len*2 + 1);
init_hexbytes_noT(hexstr,(uint8_t *)jsonstr,len); init_hexbytes_noT(hexstr,(uint8_t *)jsonstr,len);

2
iguana/exchanges/LP_nativeDEX.c

@ -148,10 +148,10 @@ int32_t LP_subsock_check(char *myipaddr,int32_t pubsock,int32_t sock,double prof
nonz++; nonz++;
if ( (argjson= cJSON_Parse((char *)ptr)) != 0 ) if ( (argjson= cJSON_Parse((char *)ptr)) != 0 )
{ {
printf("%s SUB.[%d] %s\n",myipaddr,recvsize,jprint(argjson,0));
portable_mutex_lock(&LP_commandmutex); portable_mutex_lock(&LP_commandmutex);
if ( (retstr= LP_command_process(myipaddr,pubsock,argjson,0,0,profitmargin)) != 0 ) if ( (retstr= LP_command_process(myipaddr,pubsock,argjson,0,0,profitmargin)) != 0 )
{ {
//printf("%s SUB.[%d] %s\n",peer->ipaddr,recvsize,(char *)ptr);
free(retstr); free(retstr);
} }
portable_mutex_unlock(&LP_commandmutex); portable_mutex_unlock(&LP_commandmutex);

1
iguana/exchanges/LP_utxos.c

@ -147,6 +147,7 @@ void LP_unavailableset(struct LP_utxoinfo *utxo,bits256 otherpubkey)
for (i=0; i<n; i++) for (i=0; i<n; i++)
_LP_unavailableset(ptrs[i],otherpubkey); _LP_unavailableset(ptrs[i],otherpubkey);
} }
u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee;
char str[65],str2[65]; printf("UTXO.[%d] RESERVED %s/v%d %s/v%d collisions.%d\n",utxo->iambob,bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,u.txid),u.vout,n); char str[65],str2[65]; printf("UTXO.[%d] RESERVED %s/v%d %s/v%d collisions.%d\n",utxo->iambob,bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,u.txid),u.vout,n);
_LP_unavailableset(utxo,otherpubkey); _LP_unavailableset(utxo,otherpubkey);
} }

Loading…
Cancel
Save