|
|
@ -138,9 +138,9 @@ struct LP_utxoinfo *LP_allocated(bits256 txid,int32_t vout) |
|
|
|
return(0); |
|
|
|
} |
|
|
|
|
|
|
|
int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap,char *coinaddr) |
|
|
|
int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap,char *coinaddr) |
|
|
|
{ |
|
|
|
struct LP_address_utxo *up,*tmp; int32_t n = 0; |
|
|
|
struct LP_address_utxo *up,*tmp; struct LP_transaction *tx; cJSON *txout; int32_t n = 0; |
|
|
|
//printf("LP_address_utxo_ptrs for (%s).(%s)\n",ap->coinaddr,coinaddr);
|
|
|
|
if ( strcmp(ap->coinaddr,coinaddr) != 0 ) |
|
|
|
printf("UNEXPECTED coinaddr mismatch (%s) != (%s)\n",ap->coinaddr,coinaddr); |
|
|
@ -150,6 +150,19 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 |
|
|
|
//char str[65]; printf("LP_address_utxo_ptrs %s n.%d %.8f %s v%d spendheight.%d allocated.%p\n",ap->coinaddr,n,dstr(up->U.value),bits256_str(str,up->U.txid),up->U.vout,up->spendheight,LP_allocated(up->U.txid,up->U.vout));
|
|
|
|
if ( up->spendheight <= 0 ) |
|
|
|
{ |
|
|
|
if ( coin->electrum == 0 ) |
|
|
|
{ |
|
|
|
if ( (txout= LP_gettxout(coin->symbol,coinaddr,up->U.txid,up->U.vout)) != 0 ) |
|
|
|
free_json(txout); |
|
|
|
else |
|
|
|
{ |
|
|
|
char str[65]; printf("%s %s payment %s/v%d is spent\n",coin->symbol,coinaddr,bits256_str(str,up->U.txid),up->U.vout); |
|
|
|
up->spendheight = 1; |
|
|
|
if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) |
|
|
|
tx->outpoints[up->U.vout].spendheight = 1; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
if ( LP_allocated(up->U.txid,up->U.vout) == 0 ) |
|
|
|
{ |
|
|
|
utxos[n++] = up; |
|
|
|