|
|
@ -300,7 +300,7 @@ bits256 validate_merkle(int32_t pos,bits256 txid,cJSON *proofarray,int32_t proof |
|
|
|
|
|
|
|
cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret) |
|
|
|
{ |
|
|
|
cJSON *array,*item,*merkobj,*merkles,*hdrobj; int32_t n,i,m; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; bits256 merkleroot,roothash; struct electrum_info *ep,*backupep=0; |
|
|
|
cJSON *array,*item,*merkobj,*merkles,*hdrobj; int32_t n,m; uint64_t total; struct LP_address *ap=0,*atmp; struct LP_address_utxo *up,*tmp; bits256 merkleroot,roothash; struct electrum_info *ep,*backupep=0; |
|
|
|
array = cJSON_CreateArray(); |
|
|
|
if ( coinaddr != 0 && coinaddr[0] != 0 ) |
|
|
|
{ |
|
|
@ -317,7 +317,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum |
|
|
|
{ |
|
|
|
if ( up->spendheight <= 0 && up->U.height > 0 ) |
|
|
|
{ |
|
|
|
if ( 1 && up->SPV == 0 && up->U.height > 0 ) |
|
|
|
if ( up->SPV == 0 && up->U.height > 0 ) |
|
|
|
{ |
|
|
|
if ( (merkobj= electrum_getmerkle(coin->symbol,backupep,&merkobj,up->U.txid,up->U.height)) != 0 ) |
|
|
|
{ |
|
|
@ -332,7 +332,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum |
|
|
|
if ( bits256_cmp(merkleroot,roothash) == 0 ) |
|
|
|
{ |
|
|
|
up->SPV = up->U.height; |
|
|
|
printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash)); |
|
|
|
//printf("validated MERK %s ht.%d -> %s root.(%s)\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash));
|
|
|
|
} |
|
|
|
else printf("ERROR MERK %s ht.%d -> %s root.(%s) vs %s\n",bits256_str(str,up->U.txid),up->U.height,jprint(merkobj,0),bits256_str(str2,roothash),bits256_str(str3,merkleroot)); |
|
|
|
free_json(hdrobj); |
|
|
|