Browse Source

Test

etomic
jl777 7 years ago
parent
commit
bfb02173da
  1. 2
      iguana/exchanges/LP_prices.c
  2. 4
      iguana/exchanges/LP_socket.c
  3. 7
      iguana/exchanges/LP_utxo.c

2
iguana/exchanges/LP_prices.c

@ -167,7 +167,7 @@ struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr)
ap->pubkey = pubp->pubkey;
memcpy(ap->pubsecp,pubp->pubsecp,sizeof(ap->pubsecp));
}
//printf("LP_ADDRESS %s ADD.(%s)\n",coin->symbol,coinaddr);
printf("LP_ADDRESS %s ADD.(%s)\n",coin->symbol,coinaddr);
HASH_ADD_KEYPTR(hh,coin->addresses,ap->coinaddr,strlen(ap->coinaddr),ap);
return(ap);
}

4
iguana/exchanges/LP_socket.c

@ -350,7 +350,10 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep
}
}
if ( value != 0 || tx->height > 0 )
{
printf("from electrum_process_array\n");
flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1);
}
//printf("v.%d numvouts.%d %.8f (%s)\n",v,tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0));
} //else printf("cant find tx\n");
}
@ -481,6 +484,7 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON *
if ( tx->height > 0 && tx->height != height )
printf("update %s height.%d <- %d\n",bits256_str(str,txid),tx->height,height);
tx->height = height;
printf("from history\n");
LP_address_utxoadd(coin,addr,txid,0,0,height,-1);
}
}

7
iguana/exchanges/LP_utxo.c

@ -178,7 +178,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32
struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout)
{
struct LP_address *ap; struct LP_address_utxo *up,*tmp;
//printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height);
printf("LP_address_utxofind %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height);
if ( (ap= _LP_address(coin,coinaddr)) != 0 )
{
DL_FOREACH_SAFE(ap->utxos,up,tmp)
@ -227,7 +227,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,
{
if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) == 0 )
{
printf("prevent utxoadd since gettxout %s %s %s/v%d missing\n",coin->symbol,coinaddr,bits256_str(str,txid),vout);
//printf("prevent utxoadd since gettxout %s %s %s/v%d missing\n",coin->symbol,coinaddr,bits256_str(str,txid),vout);
return(0);
} else free_json(txobj);
}
@ -484,6 +484,7 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array)
}
if ( errs == 0 )
{
printf("from LP_unspents_array\n");
LP_address_utxoadd(coin,coinaddr,txid,v,val,height,-1);
count++;
}
@ -631,6 +632,8 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf
cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj)
{
struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; cJSON *vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65];
if ( coin->inactive != 0 )
return(0);
if ( txobj != 0 || (txobj= LP_gettx(coin->symbol,txid)) != 0 )
{
if ( coin->electrum == 0 )

Loading…
Cancel
Save