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;