Browse Source

Test

etomic
jl777 8 years ago
parent
commit
14333e00e4
  1. 7
      iguana/exchanges/LP_utxos.c

7
iguana/exchanges/LP_utxos.c

@ -251,15 +251,16 @@ 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; 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 ) if ( symbol != 0 && symbol[0] != 0 )
{ {
i = 0; i = 0;
n = mypeer != 0 ? mypeer->numutxos : 0;
if ( lastn <= 0 ) if ( lastn <= 0 )
lastn = LP_PROPAGATION_SLACK * 2; lastn = LP_PROPAGATION_SLACK * 2;
if ( lastn >= mypeer->numutxos ) if ( lastn >= n )
firsti = -1; firsti = -1;
else firsti = (mypeer->numutxos - lastn); else firsti = (n - lastn);
HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp) HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp)
{ {
if ( i++ < firsti ) if ( i++ < firsti )

Loading…
Cancel
Save