From 0b15e58b29af0ebf723065666811e4a92bfd9ccd Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 3 Nov 2016 15:46:47 -0300 Subject: [PATCH] test --- iguana/iguana_ramchain.c | 1 - iguana/iguana_recv.c | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 0b68d63e2..d95aa6022 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -828,7 +828,6 @@ int64_t _iguana_rdata_action(char *fname,FILE *fp,bits256 lhashes[IGUANA_NUMLHAS S = iguana_ramchain_offset(fname,rdata,RAMCHAIN_LARG(IGUANA_LHASH_SPENDS),fparg,fpos,S,&offset,(sizeof(struct iguana_spend256) * numspends),srcsize); } Kspace = iguana_ramchain_offset(fname,rdata,RAMCHAIN_LARG(IGUANA_LHASH_KSPACE),fparg,fpos,Kspace,&offset,scriptspace,srcsize); // at the end so it can be truncated - printf("offset.%d vs alloc.%d\n",(int32_t)offset,(int32_t)srcsize); if ( (fparg= fp) == 0 ) break; lhashes = 0; diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index da708f235..eeddb2a46 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -843,6 +843,13 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru } } txdata = origtxdata; + static portable_mutex_t mutex; static int32_t didinit; + if ( didinit == 0 ) + { + portable_mutex_init(&mutex); + didinit = 1; + } + portable_mutex_lock(&mutex); if ( iguana_ramchain_data(myinfo,coin,addr,origtxdata,txarray,origtxdata->zblock.RO.txn_count,data,recvlen,bp,block,zcash) >= 0 ) { txdata->zblock.fpipbits = (uint32_t)addr->ipbits; @@ -888,6 +895,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); queue_enqueue("recvQ",&coin->recvQ,&req->DL); } + portable_mutex_unlock(&mutex); } void iguana_gottxidsM(struct iguana_info *coin,struct iguana_peer *addr,bits256 *txids,int32_t n)