From 9c4fc492337359406c905693dbacb22e41e1dbb1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Apr 2016 01:03:00 -0500 Subject: [PATCH] test --- iguana/iguana_unspents.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index eb1caeb01..b8bc02ed0 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -85,7 +85,9 @@ int32_t iguana_utxoupdate(struct iguana_info *coin,int16_t spent_hdrsi,uint32_t } hhutxo = &HHUTXO[numHHUTXO++]; memset(hhutxo,0,sizeof(*hhutxo)); - HASH_ADD(hh,coin->utxotable,uval,sizeof(uval),hhutxo); + hhutxo->uval = uval; + HASH_ADD_KEYPTR(hh,coin->utxotable,&hhutxo->uval,sizeof(hhutxo->uval),hhutxo); + //HASH_ADD(hh,coin->utxotable,uval,sizeof(uval),hhutxo); if ( (hhacct= iguana_hhaccountfind(coin,pval)) == 0 ) { if ( numHHACCT+1 >= maxHHACCT ) @@ -95,7 +97,9 @@ int32_t iguana_utxoupdate(struct iguana_info *coin,int16_t spent_hdrsi,uint32_t } hhacct = &HHACCT[numHHACCT++];//calloc(1,sizeof(*hhacct)); memset(hhacct,0,sizeof(*hhacct)); - HASH_ADD(hh,coin->accountstable,pval,sizeof(pval),hhacct); + hhacct->pval = pval; + HASH_ADD_KEYPTR(hh,coin->accountstable,&hhacct->pval,sizeof(hhacct->pval),hhacct); + //HASH_ADD(hh,coin->accountstable,pval,sizeof(pval),hhacct); } //printf("create hhutxo.%p hhacct.%p from.%d\n",hhutxo,hhacct,fromheight); hhutxo->u.spentflag = 1;