Browse Source

Test

etomic
jl777 8 years ago
parent
commit
0916bf42cf
  1. 27
      iguana/exchanges/LP_utxos.c

27
iguana/exchanges/LP_utxos.c

@ -252,23 +252,20 @@ cJSON *LP_utxojson(struct LP_utxoinfo *utxo)
char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t lastn) char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t lastn)
{ {
int32_t i,firsti,n; struct LP_utxoinfo *utxo,*tmp; cJSON *utxosjson = cJSON_CreateArray(); int32_t i,firsti,n; struct LP_utxoinfo *utxo,*tmp; cJSON *utxosjson = cJSON_CreateArray();
if ( symbol != 0 && symbol[0] != 0 ) i = 0;
n = mypeer != 0 ? mypeer->numutxos : 0;
if ( lastn <= 0 )
lastn = LP_PROPAGATION_SLACK * 2;
if ( lastn >= n )
firsti = -1;
else firsti = (n - lastn);
HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp)
{ {
i = 0; if ( i++ < firsti )
n = mypeer != 0 ? mypeer->numutxos : 0; continue;
if ( lastn <= 0 ) if ( (symbol == 0 || symbol[0] == 0 || strcmp(symbol,utxo->coin) == 0) && utxo->T.spentflag == 0 )//&& LP_ismine(utxo) > 0 )
lastn = LP_PROPAGATION_SLACK * 2;
if ( lastn >= n )
firsti = -1;
else firsti = (n - lastn);
HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp)
{ {
if ( i++ < firsti ) jaddi(utxosjson,LP_utxojson(utxo));
continue;
if ( (symbol == 0 || symbol[0] == 0 || strcmp(symbol,utxo->coin) == 0) && utxo->T.spentflag == 0 )//&& LP_ismine(utxo) > 0 )
{
jaddi(utxosjson,LP_utxojson(utxo));
}
} }
} }
return(jprint(utxosjson,1)); return(jprint(utxosjson,1));

Loading…
Cancel
Save