From 70736e4ab3d6771d88aafaf6894b90292661842c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 21 Mar 2018 22:11:37 +0200 Subject: [PATCH] Test --- iguana/dpow/dpow_fsm.c | 4 ++-- iguana/iguana_init.c | 1 + includes/iguana_structs.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index b4d05421e..6a61c2f0e 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -401,10 +401,10 @@ void dpow_statemachinestart(void *ptr) else if ( strcmp(dest->symbol,"KMD") == 0 ) { kmdheight = dest->longestchain; - portable_mutex_lock(&myinfo->MoM_mutex); + portable_mutex_lock(&dest->MoM_mutex); //if ( Notaries_port != DPOW_SOCKPORT ) MoM = dpow_calcMoM(&MoMdepth,myinfo,src,checkpoint.blockhash.height); - portable_mutex_unlock(&myinfo->MoM_mutex); + portable_mutex_unlock(&dest->MoM_mutex); } if ( (bp= dp->blocks[checkpoint.blockhash.height]) == 0 ) { diff --git a/iguana/iguana_init.c b/iguana/iguana_init.c index bb3c92135..473b46953 100755 --- a/iguana/iguana_init.c +++ b/iguana/iguana_init.c @@ -68,6 +68,7 @@ void iguana_initcoin(struct iguana_info *coin,cJSON *argjson) portable_mutex_init(&coin->RTmutex); portable_mutex_init(&coin->kmdmutex); portable_mutex_init(&coin->peers_mutex); + portable_mutex_init(&coin->MoM_mutex); portable_mutex_init(&coin->blocks_mutex); portable_mutex_init(&coin->special_mutex); portable_mutex_init(&coin->allcoins_mutex); diff --git a/includes/iguana_structs.h b/includes/iguana_structs.h index e92e40fa3..feaf910e7 100755 --- a/includes/iguana_structs.h +++ b/includes/iguana_structs.h @@ -511,7 +511,7 @@ struct iguana_info struct OS_memspace TXMEM,MEM,MEMB[IGUANA_MAXBUNDLESIZE]; queue_t acceptQ,hdrsQ,blocksQ,priorityQ,possibleQ,cacheQ,recvQ,msgrequestQ,jsonQ,finishedQ; double parsemillis,avetime; uint32_t Launched[8],Terminated[8]; - portable_mutex_t peers_mutex,blocks_mutex,special_mutex,RTmutex,allcoins_mutex; + portable_mutex_t peers_mutex,blocks_mutex,special_mutex,RTmutex,allcoins_mutex,MoM_mutex; char changeaddr[64]; struct iguana_bundle *bundles[IGUANA_MAXBUNDLES],*current,*lastpending; struct OS_memspace RTrawmem,RTmem,RThashmem; // struct iguana_ramchain RTramchain;