Browse Source

Test

etomic
jl777 7 years ago
parent
commit
e013029c47
  1. 6
      iguana/exchanges/LP_nativeDEX.c
  2. 3
      iguana/exchanges/LP_signatures.c
  3. 2
      iguana/exchanges/LP_utxo.c

6
iguana/exchanges/LP_nativeDEX.c

@ -1229,9 +1229,7 @@ void *LP_alloc(uint64_t len)
//return(calloc(1,len));
struct LP_memory_list *mp;
mp = calloc(1,sizeof(*mp) + len);
//if ( len == 72 )
// printf("%d\n",1/zeroval());
//printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,mp->ptr,(long long)len);
printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,mp->ptr,(long long)len);
mp->timestamp = (uint32_t)time(NULL);
mp->len = (uint32_t)len;
mp->ptr = calloc(1,len);
@ -1287,7 +1285,7 @@ void LP_free(void *ptr)
portable_mutex_lock(&LP_cJSONmutex);
DL_DELETE(LP_memory_list,mp);
portable_mutex_unlock(&LP_cJSONmutex);
//printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u\n",ptr,mp,mp->len);
printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u\n",ptr,mp,mp->len);
free(mp->ptr);
free(mp);
} else unknown++; // free from source file with #define redirect for alloc that wasnt

3
iguana/exchanges/LP_signatures.c

@ -649,6 +649,7 @@ void LP_smartutxos_push(struct iguana_info *coin)
char *LP_uitem_recv(cJSON *argjson)
{
bits256 txid; int32_t vout,height; uint64_t value; struct iguana_info *coin; char *coinaddr,*symbol;
printf("LP_uitem_recv.0 %ld\n",LP_cjson_allocated);
txid = jbits256(argjson,"txid");
vout = jint(argjson,"vout");
height = jint(argjson,"ht");
@ -660,7 +661,9 @@ char *LP_uitem_recv(cJSON *argjson)
if ( strcmp(coin->smartaddr,coinaddr) != 0 )
LP_address_utxoadd((uint32_t)time(NULL),"LP_uitem_recv",coin,coinaddr,txid,vout,value,height,-1);
//else printf("ignore external uitem %s %s\n",symbol,coin->smartaddr);
printf("LP_uitem_recv.1 %ld\n",LP_cjson_allocated);
}
printf("LP_uitem_recv.2 %ld\n",LP_cjson_allocated);
return(clonestr("{\"result\":\"success\"}"));
}

2
iguana/exchanges/LP_utxo.c

@ -423,6 +423,7 @@ void LP_mark_spent(char *symbol,bits256 txid,int32_t vout)
int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight)
{
struct LP_address *ap; cJSON *txobj; struct LP_transaction *tx; struct LP_address_utxo *up,*tmp; int32_t flag,retval = 0; //char str[65];
printf("LP_address_utxoadd.0 %ld\n",LP_cjson_allocated);
if ( coin == 0 )
return(0);
if ( spendheight > 0 ) // dont autocreate entries for spends we dont care about
@ -479,6 +480,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co
}
} // else printf("cant get ap %s %s\n",coin->symbol,coinaddr);
//printf("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height);
printf("LP_address_utxoadd.1 %ld\n",LP_cjson_allocated);
return(retval);
}

Loading…
Cancel
Save