Browse Source

Test

etomic
jl777 7 years ago
parent
commit
6b01280d17
  1. 3
      iguana/exchanges/LP_cache.c
  2. 6
      iguana/exchanges/LP_utxo.c

3
iguana/exchanges/LP_cache.c

@ -105,8 +105,7 @@ void LP_SPV_store(struct iguana_info *coin,bits256 txid,int32_t height)
fwrite(tx->serialized,1,tx->len,fp);
fclose(fp);
}
}
else printf("cant store %s %s tx.%p [%d] fpos.%ld SPV.%d\n",coin->symbol,bits256_str(str,txid),tx,tx!=0?tx->len:-1,tx!=0?tx->fpos:-1,tx!=0?tx->SPV:-1);
} //else printf("cant store %s %s tx.%p [%d] fpos.%ld SPV.%d\n",coin->symbol,bits256_str(str,txid),tx,tx!=0?tx->len:-1,tx!=0?tx->fpos:-1,tx!=0?tx->SPV:-1);
}
int32_t LP_cacheitem(struct iguana_info *coin,FILE *fp)

6
iguana/exchanges/LP_utxo.c

@ -533,14 +533,14 @@ struct LP_transaction *LP_transactionfind(struct iguana_info *coin,bits256 txid)
struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,int32_t height,int32_t numvouts,int32_t numvins)
{
static long totalsize;
struct LP_transaction *tx; int32_t i; char str[65];
struct LP_transaction *tx; int32_t i; //char str[65];
if ( (tx= LP_transactionfind(coin,txid)) == 0 )
{
//if ( bits256_nonz(txid) == 0 && tx->height == 0 )
// getchar();
tx = calloc(1,sizeof(*tx) + (sizeof(*tx->outpoints) * numvouts));
totalsize += sizeof(*tx) + (sizeof(*tx->outpoints) * numvouts);
char str[65]; printf("%s ht.%d NEW TXID.(%s) vouts.[%d] size.%ld total %ld\n",coin->symbol,height,bits256_str(str,txid),numvouts,sizeof(*tx) + (sizeof(*tx->outpoints) * numvouts),totalsize);
//char str[65]; printf("%s ht.%d NEW TXID.(%s) vouts.[%d] size.%ld total %ld\n",coin->symbol,height,bits256_str(str,txid),numvouts,sizeof(*tx) + (sizeof(*tx->outpoints) * numvouts),totalsize);
for (i=0; i<numvouts; i++)
tx->outpoints[i].spendvini = -1;
tx->height = height;
@ -551,7 +551,7 @@ struct LP_transaction *LP_transactionadd(struct iguana_info *coin,bits256 txid,i
portable_mutex_lock(&coin->txmutex);
HASH_ADD_KEYPTR(hh,coin->transactions,tx->txid.bytes,sizeof(tx->txid),tx);
portable_mutex_unlock(&coin->txmutex);
} else printf("warning adding already existing txid %s\n",bits256_str(str,tx->txid));
} //else printf("warning adding already existing txid %s\n",bits256_str(str,tx->txid));
return(tx);
}

Loading…
Cancel
Save