jl777 8 years ago
parent
commit
03007dfbe1
  1. 4
      iguana/exchanges/LP_socket.c
  2. 9
      iguana/exchanges/LP_utxo.c

4
iguana/exchanges/LP_socket.c

@ -519,9 +519,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON
cJSON *retjson=0; struct LP_address *ap; struct iguana_info *coin; int32_t height,usecache=1; cJSON *retjson=0; struct LP_address *ap; struct iguana_info *coin; int32_t height,usecache=1;
if ( (coin= LP_coinfind(symbol)) == 0 ) if ( (coin= LP_coinfind(symbol)) == 0 )
return(0); return(0);
if ( ep->heightp == 0 ) height = coin->longestchain;
height = coin->longestchain;
else height = *(ep->heightp);
if ( (ap= LP_address(coin,addr)) != 0 ) if ( (ap= LP_address(coin,addr)) != 0 )
{ {
if ( ap->unspenttime == 0 ) if ( ap->unspenttime == 0 )

9
iguana/exchanges/LP_utxo.c

@ -191,6 +191,11 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a
break; break;
} }
} }
else
{
if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts )
tx->outpoints[up->U.vout].spendheight = 1;
}
} }
portable_mutex_unlock(&LP_utxomutex); portable_mutex_unlock(&LP_utxomutex);
//printf("return n.%d\n",n); //printf("return n.%d\n",n);
@ -276,8 +281,8 @@ int32_t LP_address_utxoadd(char *debug,struct iguana_info *coin,char *coinaddr,b
DL_APPEND(ap->utxos,up); DL_APPEND(ap->utxos,up);
portable_mutex_unlock(&coin->addrmutex); portable_mutex_unlock(&coin->addrmutex);
retval = 1; retval = 1;
if ( value == 0 ) //if ( value == 0 )
printf("%s null? ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); printf("%s ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",debug,coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value));
} }
} // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); } // 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("done %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height);

Loading…
Cancel
Save