|
|
@ -871,6 +871,10 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid) |
|
|
|
bits256 blockhash; struct LP_transaction *tx; cJSON *blockobj,*retjson,*txobj; int32_t height = 0; |
|
|
|
if ( coin == 0 ) |
|
|
|
return(-1); |
|
|
|
if ( (tx= LP_transactionfind(coin,txid)) != 0 ) |
|
|
|
height = tx->height; |
|
|
|
if ( height > 0 ) |
|
|
|
return(height); |
|
|
|
if ( coin->electrum == 0 ) |
|
|
|
{ |
|
|
|
if ( (txobj= LP_gettx("LP_txheight",coin->symbol,txid,0)) != 0 ) |
|
|
@ -881,6 +885,8 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid) |
|
|
|
if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 ) |
|
|
|
{ |
|
|
|
height = jint(blockobj,"height"); |
|
|
|
if ( tx != 0 ) |
|
|
|
tx->height = height; |
|
|
|
//char str[65];
|
|
|
|
//if ( strcmp(coin->symbol,"CHIPS") != 0 && strcmp(coin->symbol,"BTC") != 0 )
|
|
|
|
// printf("%s %s LP_txheight.%d\n",coin->symbol,bits256_str(str,txid),height);
|
|
|
@ -891,8 +897,6 @@ int32_t LP_txheight(struct iguana_info *coin,bits256 txid) |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if ( (tx= LP_transactionfind(coin,txid)) != 0 ) |
|
|
|
height = tx->height; |
|
|
|
if ( height == 0 ) |
|
|
|
{ |
|
|
|
if ( (retjson= electrum_transaction(&height,coin->symbol,coin->electrum,&retjson,txid,0)) != 0 ) |
|
|
|