From de60d7209db9164cd9b6d054cd026b89367c037b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 4 Apr 2016 17:10:09 -0500 Subject: [PATCH] test --- iguana/iguana777.h | 2 +- iguana/iguana_unspents.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/iguana777.h b/iguana/iguana777.h index ce800caa8..c5f41e4aa 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -477,7 +477,7 @@ struct iguana_info struct iguana_bitmap screen; //struct pollfd fds[IGUANA_MAXPEERS]; struct iguana_peer bindaddr; int32_t numsocks; - struct OS_memspace TXMEM,MEM,MEMB[IGUANA_MAXBUNDLESIZE]; + struct OS_memspace RTHASHMEM,TXMEM,MEM,MEMB[IGUANA_MAXBUNDLESIZE]; queue_t acceptQ,hdrsQ,blocksQ,priorityQ,possibleQ,cacheQ,recvQ; double parsemillis,avetime; uint32_t Launched[8],Terminated[8]; portable_mutex_t peers_mutex,blocks_mutex; diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 3183e28fd..2aaff7fe8 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -13,6 +13,10 @@ * * ******************************************************************************/ + +#define uthash_malloc(size) iguana_memalloc(&coin->RThashmem,size,1) +#define uthash_free(ptr,size) + #include "iguana777.h" #include "exchanges/bitcoin.h" @@ -1351,6 +1355,7 @@ void iguana_RTramchainfree(struct iguana_info *coin) coin->RTheight = coin->balanceswritten * coin->chain->bundlesize; coin->RTgenesis = 0; iguana_ramchain_free(coin,&coin->RTramchain,1); + iguana_mempurge(&coin->RTHASHMEM); } void iguana_RTramchainalloc(struct iguana_info *coin,struct iguana_bundle *bp) @@ -1386,6 +1391,8 @@ void iguana_RTramchainalloc(struct iguana_info *coin,struct iguana_bundle *bp) dest->H.txidind = dest->H.unspentind = dest->H.spendind = dest->pkind = dest->H.data->firsti; dest->externalind = dest->H.stacksize = 0; dest->H.scriptoffset = 1; + if ( coin->RTHASHMEM.ptr == 0 ) + iguana_meminit(&coin->RTHASHMEM,"RTHASH",0,1024L*1024L*1024L,0); if ( coin->PREFETCHLAG != 0 ) { iguana_ramchain_prefetch(coin,&coin->RTramchain,0);