From 516cb8ee2d00c4109d815f441e6c5b19db28704b Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 19 Aug 2016 16:07:16 -0300 Subject: [PATCH] test --- iguana/iguana_realtime.c | 9 ++++++--- includes/iguana_funcs.h | 7 ++++--- includes/iguana_structs.h | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/iguana/iguana_realtime.c b/iguana/iguana_realtime.c index 7a9de0aae..db8f9afbd 100755 --- a/iguana/iguana_realtime.c +++ b/iguana/iguana_realtime.c @@ -490,9 +490,12 @@ void iguana_RTspend(struct iguana_info *coin,struct iguana_RTtxid *RTptr,struct { if ( bits256_cmp(RTptr->txid,txid) == 0 ) { - if ( polarity > 0 ) + if ( (spend= RTptr->spends[vini]) == 0 ) { - + if ( polarity > 0 ) + { + + } else printf("iguana_RTspend missing vini.%d ptr\n",vini); } } else printf("iguana_RTspend txid mismatch %llx != %llx\n",(long long)RTptr->txid.txid,(long long)txid.txid); } else printf("null rtptr? %s vini.%d spend.(%s/v%d) %lld\n",bits256_str(str,txid),vini,bits256_str(str2,prev_hash),prev_vout,(long long)polarity); @@ -533,7 +536,7 @@ struct iguana_RTtxid *iguana_RTtxid(struct iguana_info *coin,struct iguana_block RTptr->numvins = numvins; RTptr->locktime = locktime; RTptr->version = version; - RTptr->timestamp timestamp; + RTptr->timestamp = timestamp; RTptr->unspents = (void *)&RTptr->spends[numvins]; HASH_ADD_KEYPTR(hh,coin->RTdataset,RTptr->txid.bytes,sizeof(RTptr->txid),RTptr); // add to hashtable block <-> txids[] diff --git a/includes/iguana_funcs.h b/includes/iguana_funcs.h index 1fba4d1ce..56d977833 100755 --- a/includes/iguana_funcs.h +++ b/includes/iguana_funcs.h @@ -540,9 +540,10 @@ int32_t iguana_scriptdata(struct iguana_info *coin,uint8_t *scriptspace,long fil struct iguana_peer *basilisk_ensurerelay(struct supernet_info *myinfo,struct iguana_info *btcd,uint32_t ipbits); int32_t iguana_datachain_scan(struct supernet_info *myinfo,struct iguana_info *coin,uint8_t rmd160[20]); int32_t iguana_RTramchaindata(struct iguana_info *coin,struct OS_memspace *TXDATA,struct OS_memspace *HASHMEM,int64_t polarity,struct iguana_block *block,struct iguana_msgtx *txarray,int32_t txn_count); -struct iguana_RTdata *iguana_RTtxid(struct iguana_info *coin,struct iguana_block *block,int64_t polarity,int32_t txn_count,bits256 txid,int32_t numvouts,int32_t numvins,uint32_t locktime,uint32_t version,uint32_t timestamp); -void iguana_RTspend(struct iguana_info *coin,struct iguana_RTdata *RTptr,struct iguana_block *block,int64_t polarity,uint8_t *script,int32_t scriptlen,bits256 txid,int32_t vini,bits256 prev_hash,int32_t prev_vout); -void iguana_RTunspent(struct iguana_info *coin,struct iguana_RTdata *RTptr,struct iguana_block *block,int64_t polarity,char *coinaddr,uint8_t *rmd160,int32_t type,uint8_t *script,int32_t scriptlen,bits256 txid,int32_t vout,int64_t value); +struct iguana_RTtxid *iguana_RTtxid(struct iguana_info *coin,struct iguana_block *block,int64_t polarity,int32_t txn_count,bits256 txid,int32_t numvouts,int32_t numvins,uint32_t locktime,uint32_t version,uint32_t timestamp); +void iguana_RTspend(struct iguana_info *coin,struct iguana_RTtxid *RTptr,struct iguana_block *block,int64_t polarity,uint8_t *script,int32_t scriptlen,bits256 txid,int32_t vini,bits256 prev_hash,int32_t prev_vout); +void iguana_RTunspent(struct iguana_info *coin,struct iguana_RTtxid *RTptr,struct iguana_block *block,int64_t polarity,char *coinaddr,uint8_t *rmd160,int32_t type,uint8_t *script,int32_t scriptlen,bits256 txid,int32_t vout,int64_t value); + void iguana_RTreset(struct iguana_info *coin); void iguana_RTpurge(struct iguana_info *coin,int32_t lastheight); void iguana_RTnewblock(struct iguana_info *coin,struct iguana_block *block); diff --git a/includes/iguana_structs.h b/includes/iguana_structs.h index 72c0abe28..02d391e40 100755 --- a/includes/iguana_structs.h +++ b/includes/iguana_structs.h @@ -400,8 +400,8 @@ struct iguana_RTtxid bits256 txid; int32_t txn_count,numvouts,numvins; uint32_t locktime,version,timestamp; - struct iguana_RTunspent *unspents; - struct iguana_RTspend spends[]; + struct iguana_RTunspent **unspents; + struct iguana_RTspend *spends[]; }; struct iguana_info