Browse Source

Test

etomic
jl777 7 years ago
parent
commit
01d717e3a6
  1. 4
      iguana/exchanges/LP_commands.c
  2. 4
      iguana/exchanges/LP_nativeDEX.c
  3. 5
      iguana/exchanges/LP_network.c

4
iguana/exchanges/LP_commands.c

@ -291,8 +291,8 @@ trust(pubkey, trust)\n\
else if ( strcmp(method,"utxo") == 0 ) else if ( strcmp(method,"utxo") == 0 )
{ {
if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 ) if ( LP_utxoaddjson(1,LP_mypubsock,argjson) != 0 )
retstr = clonestr("{\"result\":\"success\",\"notifyutxo\":\"received\"}"); return(clonestr("{\"result\":\"success\",\"utxo\":\"received\"}"));
else retstr = clonestr("{\"result\":\"couldnt add utxo\"}"); else return(clonestr("{\"result\":\"couldnt add utxo\"}"));
} }
else else
{ {

4
iguana/exchanges/LP_nativeDEX.c

@ -122,7 +122,7 @@ int32_t LP_crc32find(int32_t *duplicatep,int32_t ind,uint32_t crc32)
crcs[i] = crcs[i >> 1]; crcs[i] = crcs[i >> 1];
crcs[i >> 1] = crc32; crcs[i >> 1] = crc32;
dup++; dup++;
printf("duplicate %08x in slot %d -> slot %d (%lu / %lu)\n",crc32,i,i>>1,dup,total); printf("duplicate %u in slot %d -> slot %d (%lu / %lu)\n",crc32,i,i>>1,dup,total);
} }
*duplicatep = 1; *duplicatep = 1;
break; break;
@ -317,7 +317,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int
void command_rpcloop(void *myipaddr) void command_rpcloop(void *myipaddr)
{ {
int32_t nonz = 0; char *origipaddr; struct iguana_info *coin,*ctmp; struct LP_peerinfo *peer,*tmp; void *ctx; int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; void *ctx; //struct iguana_info *coin,*ctmp;
ctx = bitcoin_ctx(); ctx = bitcoin_ctx();
if ( (origipaddr= myipaddr) == 0 ) if ( (origipaddr= myipaddr) == 0 )
origipaddr = "127.0.0.1"; origipaddr = "127.0.0.1";

5
iguana/exchanges/LP_network.c

@ -92,6 +92,8 @@ int32_t LP_Qenqueued,LP_Qdequeued;
void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind)
{ {
struct LP_queue *ptr; struct LP_queue *ptr;
if ( LP_Qenqueued == 0 )
{
ptr = calloc(1,sizeof(*ptr) + msglen); ptr = calloc(1,sizeof(*ptr) + msglen);
ptr->crc32 = crc32; ptr->crc32 = crc32;
ptr->sock = sock; ptr->sock = sock;
@ -100,7 +102,8 @@ void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,in
memcpy(ptr->msg,msg,msglen); memcpy(ptr->msg,msg,msglen);
DL_APPEND(LP_Q,ptr); DL_APPEND(LP_Q,ptr);
LP_Qenqueued++; LP_Qenqueued++;
printf("Q.%p: peerind.%d msglen.%d\n",ptr,peerind,msglen); //printf("Q.%p: peerind.%d msglen.%d\n",ptr,peerind,msglen);
}
} }
void queue_loop(void *ignore) void queue_loop(void *ignore)

Loading…
Cancel
Save