|
@ -45,6 +45,7 @@ int32_t _LP_inuse_delete(bits256 txid,int32_t vout) |
|
|
if ( (lp= _LP_inuse_find(txid,vout)) != 0 ) |
|
|
if ( (lp= _LP_inuse_find(txid,vout)) != 0 ) |
|
|
{ |
|
|
{ |
|
|
ind = lp->ind; |
|
|
ind = lp->ind; |
|
|
|
|
|
char str[65]; printf("_LP_inuse_delete removing %s/v%d\n",bits256_str(str,txid),vout); |
|
|
*lp = LP_inuse[--LP_numinuse]; |
|
|
*lp = LP_inuse[--LP_numinuse]; |
|
|
lp->ind = ind; |
|
|
lp->ind = ind; |
|
|
memset(&LP_inuse[LP_numinuse],0,sizeof(struct LP_inuse_info)); |
|
|
memset(&LP_inuse[LP_numinuse],0,sizeof(struct LP_inuse_info)); |
|
@ -52,7 +53,6 @@ int32_t _LP_inuse_delete(bits256 txid,int32_t vout) |
|
|
if ( LP_inuse[ind].ind != ind ) |
|
|
if ( LP_inuse[ind].ind != ind ) |
|
|
printf("ind.%d of %d: mismatched ind.%d\n",ind,LP_numinuse,LP_inuse[ind].ind); |
|
|
printf("ind.%d of %d: mismatched ind.%d\n",ind,LP_numinuse,LP_inuse[ind].ind); |
|
|
} |
|
|
} |
|
|
//char str[65]; printf("_LP_inuse_delete cant find %s/v%d\n",bits256_str(str,txid),vout);
|
|
|
|
|
|
return(-1); |
|
|
return(-1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -423,7 +423,7 @@ int32_t LP_address_utxoadd(uint32_t timestamp,char *debug,struct iguana_info *co |
|
|
|
|
|
|
|
|
struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) |
|
|
struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) |
|
|
{ |
|
|
{ |
|
|
struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t i,n,vout,height; cJSON *array,*item,*txobj; int64_t value; bits256 txid; uint32_t now; |
|
|
struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t i,n,m,vout,height; cJSON *array,*item,*txobj; int64_t value; bits256 txid; uint32_t now; |
|
|
LP_address(coin,coin->smartaddr); |
|
|
LP_address(coin,coin->smartaddr); |
|
|
LP_listunspent_issue(coin->symbol,coin->smartaddr,2); |
|
|
LP_listunspent_issue(coin->symbol,coin->smartaddr,2); |
|
|
if ( (ap= LP_addressfind(coin,coin->smartaddr)) == 0 ) |
|
|
if ( (ap= LP_addressfind(coin,coin->smartaddr)) == 0 ) |
|
@ -447,7 +447,7 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) |
|
|
if ( (n= cJSON_GetArraySize(array)) > 0 ) |
|
|
if ( (n= cJSON_GetArraySize(array)) > 0 ) |
|
|
{ |
|
|
{ |
|
|
char str[65]; |
|
|
char str[65]; |
|
|
for (i=0; i<n; i++) |
|
|
for (i=m=0; i<n; i++) |
|
|
{ |
|
|
{ |
|
|
//{"tx_hash":"38d1b7c73015e1b1d6cb7fc314cae402a635b7d7ea294970ab857df8777a66f4","tx_pos":0,"height":577975,"value":238700}
|
|
|
//{"tx_hash":"38d1b7c73015e1b1d6cb7fc314cae402a635b7d7ea294970ab857df8777a66f4","tx_pos":0,"height":577975,"value":238700}
|
|
|
item = jitem(array,i); |
|
|
item = jitem(array,i); |
|
@ -458,8 +458,9 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) |
|
|
LP_address_utxoadd(now,"withdraw",coin,coin->smartaddr,txid,vout,value,height,-1); |
|
|
LP_address_utxoadd(now,"withdraw",coin,coin->smartaddr,txid,vout,value,height,-1); |
|
|
if ( (up= LP_address_utxofind(coin,coin->smartaddr,txid,vout)) == 0 ) |
|
|
if ( (up= LP_address_utxofind(coin,coin->smartaddr,txid,vout)) == 0 ) |
|
|
printf("couldnt find just added %s/%d ht.%d %.8f\n",bits256_str(str,txid),vout,height,dstr(value)); |
|
|
printf("couldnt find just added %s/%d ht.%d %.8f\n",bits256_str(str,txid),vout,height,dstr(value)); |
|
|
|
|
|
else m++; |
|
|
} |
|
|
} |
|
|
printf("added %d from listunspents\n",n); |
|
|
printf("added %d from listunspents\n",m); |
|
|
} |
|
|
} |
|
|
free_json(array); |
|
|
free_json(array); |
|
|
} |
|
|
} |
|
|