diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 4423aa7e5..f741bd24f 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -87,8 +87,10 @@ void LP_SPV_store(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t h struct LP_outpoint outpoints[]; };*/ -int32_t LP_cacheitem(struct iguana_info *coin,uint8_t *ptr,long remains) +int32_t LP_cacheitem(struct iguana_info *coin,struct LP_transaction *tx,long remains) { + int32_t offset; + return(-1); } @@ -101,13 +103,15 @@ void *LP_cacheptrs_init(FILE **wfp,long *fsizep,struct iguana_info *coin) ptr = OS_portable_mapfile(fname,fsizep,0); while ( len < *fsizep ) { - if ( (n= LP_cacheitem(coin,&ptr[len],*fsizep - len)) < 0 ) + if ( (n= LP_cacheitem(coin,(struct LP_transaction *)&ptr[len],*fsizep - len)) < 0 ) { printf("cacheitem error at %s offset.%ld when fsize.%ld\n",coin->symbol,len,*fsizep); fseek(*wfp,len,SEEK_SET); break; } len += n; + if ( (len & 1) != 0 ) + printf("odd offset at %ld\n",len); } } return(ptr); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 6101c6681..a1b7e98ca 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -239,13 +239,20 @@ struct LP_swap_remember char src[64],dest[64],destaddr[64],Adestaddr[64],Sdestaddr[64],alicepaymentaddr[64],bobpaymentaddr[64],bobdepositaddr[64],alicecoin[64],bobcoin[64],*txbytes[sizeof(txnames)/sizeof(*txnames)]; }; -struct LP_outpoint { bits256 spendtxid; uint64_t value,interest; int32_t spendvini,spendheight; char coinaddr[64]; }; +struct LP_outpoint +{ + bits256 spendtxid; + uint64_t value,interest; + int32_t spendvini,spendheight; + char coinaddr[56]; +}; struct LP_transaction { UT_hash_handle hh; bits256 txid; - int32_t height,numvouts,numvins,len,SPV; + int32_t height,len,SPV; + uint16_t numvouts,numvins; uint8_t *serialized; struct LP_outpoint outpoints[]; }; diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 50e8b2c69..33946846e 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -500,7 +500,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_ if ( iguana_rwmsgtx(taddr,pubtype,p2shtype,isPoS,height,0,0,serialized,maxsize,msgtx,&txid,"",extraspace,extralen,vins,V->suppress_pubkeys,zcash) > 0 && numinputs == msgtx->tx_in ) { memset(pubkeys,0,sizeof(pubkeys)); - memset(privkeys,0,sizeof(privkeys)); + memset(privkeys,0,sizeof(*privkeys)*numinputs); if ( (n= cJSON_GetArraySize(privkeysjson)) > 0 ) { for (i=0; i