Browse Source

Move gettxout check

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

4
iguana/exchanges/LP_rpc.c

@ -254,6 +254,8 @@ cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout)
return(cJSON_Parse("{\"error\":\"no coin\"}")); return(cJSON_Parse("{\"error\":\"no coin\"}"));
if ( bits256_nonz(txid) == 0 ) if ( bits256_nonz(txid) == 0 )
return(cJSON_Parse("{\"error\":\"null txid\"}")); return(cJSON_Parse("{\"error\":\"null txid\"}"));
if ( coin->electrum == 0 )
{
if ( (tx= LP_transactionfind(coin,txid)) != 0 && vout < tx->numvouts ) if ( (tx= LP_transactionfind(coin,txid)) != 0 && vout < tx->numvouts )
{ {
if ( tx->outpoints[vout].spendheight > 0 ) if ( tx->outpoints[vout].spendheight > 0 )
@ -263,8 +265,6 @@ cJSON *LP_gettxout(char *symbol,char *coinaddr,bits256 txid,int32_t vout)
} }
//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); sprintf(buf,"[\"%s\", %d, true]",bits256_str(str,txid),vout);
return(bitcoin_json(coin,"gettxout",buf)); 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 ) 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 ) else if ( strcmp(coin->symbol,"KMD") == 0 )
{ {

Loading…
Cancel
Save