Browse Source

Move gettxout check

patch-4
jl777 7 years ago
parent
commit
db66058ae5
  1. 16
      iguana/exchanges/LP_rpc.c
  2. 2
      iguana/exchanges/LP_utxo.c

16
iguana/exchanges/LP_rpc.c

@ -254,17 +254,17 @@ cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout)
return(cJSON_Parse("{\"error\":\"no coin\"}"));
if ( bits256_nonz(txid) == 0 )
return(cJSON_Parse("{\"error\":\"null txid\"}"));
if ( (tx= LP_transactionfind(coin,txid)) != 0 && vout < tx->numvouts )
if ( coin->electrum == 0 )
{
if ( tx->outpoints[vout].spendheight > 0 )
if ( (tx= LP_transactionfind(coin,txid)) != 0 && vout < tx->numvouts )
{
fprintf(stderr,"LP_gettxout (%s) tx->outpoints[vout].spendheight > 0\n",coinaddr);
return(0);
if ( tx->outpoints[vout].spendheight > 0 )
{
fprintf(stderr,"LP_gettxout (%s) tx->outpoints[vout].spendheight > 0\n",coinaddr);
return(0);
}
//return(LP_gettxout_json(txid,vout,tx->height,tx->outpoints[vout].coinaddr,tx->outpoints[vout].value));
}
//return(LP_gettxout_json(txid,vout,tx->height,tx->outpoints[vout].coinaddr,tx->outpoints[vout].value));
}
if ( coin->electrum == 0 )
{
sprintf(buf,"[\"%s\", %d, true]",bits256_str(str,txid),vout);
return(bitcoin_json(coin,"gettxout",buf));
}

2
iguana/exchanges/LP_utxo.c

@ -1075,7 +1075,7 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf
{
if ( (value= LP_value_extract(txobj,0,txid)) == 0 )
{
char str[65]; printf("%s LP_txvalue.%s strange utxo.(%s) vout.%d\n",coin->symbol,bits256_str(str,txid),jprint(txobj,0),vout);
// char str[65]; printf("%s LP_txvalue.%s strange utxo.(%s) vout.%d\n",coin->symbol,bits256_str(str,txid),jprint(txobj,0),vout);
}
else if ( strcmp(coin->symbol,"KMD") == 0 )
{

Loading…
Cancel
Save