Browse Source

Test

etomic
jl777 7 years ago
parent
commit
b1450a1670
  1. 6
      iguana/exchanges/LP_cache.c
  2. 8
      iguana/exchanges/LP_transaction.c

6
iguana/exchanges/LP_cache.c

@ -90,7 +90,11 @@ void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t h
int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long remains)
{
int32_t offset;
offset = sizeof(*tx) + tx->numvouts*sizeof(*tx->outpoints);
if ( offset+tx->len <= remains )
{
return(0);
}
return(-1);
}

8
iguana/exchanges/LP_transaction.c

@ -247,7 +247,10 @@ int32_t iguana_msgtx_Vset(uint8_t *serialized,int32_t maxlen,struct iguana_msgtx
int32_t iguana_interpreter(struct iguana_info *coin,cJSON *logarray,int64_t nLockTime,struct vin_info *V,int32_t numvins)
{
uint8_t script[IGUANA_MAXSCRIPTSIZE],*activescript,savescript[IGUANA_MAXSCRIPTSIZE]; char str[IGUANA_MAXSCRIPTSIZE*2+1]; int32_t vini,scriptlen,activescriptlen,savelen,errs = 0; cJSON *spendscript,*item=0;
uint8_t *script,*activescript,*savescript; char *str; int32_t vini,scriptlen,activescriptlen,savelen,errs = 0; cJSON *spendscript,*item=0;
script = calloc(1,IGUANA_MAXSCRIPTSIZE);
savescript = calloc(1,IGUANA_MAXSCRIPTSIZE);
str = calloc(1,IGUANA_MAXSCRIPTSIZE*2+1);
for (vini=0; vini<numvins; vini++)
{
savelen = V[vini].spendlen;
@ -297,6 +300,9 @@ int32_t iguana_interpreter(struct iguana_info *coin,cJSON *logarray,int64_t nLoc
memcpy(V[vini].spendscript,savescript,savelen);
V[vini].spendlen = savelen;
}
free(str);
free(script);
free(savescript);
if ( errs != 0 )
return(-errs);
if ( logarray != 0 )

Loading…
Cancel
Save