diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a03d9f858..8e0a3c045 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -543,24 +543,27 @@ void LP_coinsloop(void *_coins) { DL_FOREACH_SAFE(ap->utxos,up,tmp) { - if ( up->SPV == 0 ) + if ( up->U.height > 0 && up->spendheight < 0 ) { - nonz++; - up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( up->SPV > 0 ) - printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); - } - else if ( up->SPV == -1 ) - { - nonz++; - printf("SPV failure for %s %s\n",coin->symbol,bits256_str(str,up->U.txid)); - oldht = up->U.height; - LP_txheight_check(coin,ap->coinaddr,up); - if ( oldht != up->U.height ) + if ( up->SPV == 0 ) + { + nonz++; up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); - if ( up->SPV <= 0 ) - up->SPV = -2; - else printf("%s %s: corrected SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + if ( up->SPV > 0 ) + printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + } + else if ( up->SPV == -1 ) + { + nonz++; + printf("SPV failure for %s %s\n",coin->symbol,bits256_str(str,up->U.txid)); + oldht = up->U.height; + LP_txheight_check(coin,ap->coinaddr,up); + if ( oldht != up->U.height ) + up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height); + if ( up->SPV <= 0 ) + up->SPV = -2; + else printf("%s %s: corrected SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); + } } } }