Use CC mutex
This commit is contained in:
@@ -30,12 +30,15 @@
|
|||||||
|
|
||||||
Eval* EVAL_TEST = 0;
|
Eval* EVAL_TEST = 0;
|
||||||
struct CCcontract_info CCinfos[0x100];
|
struct CCcontract_info CCinfos[0x100];
|
||||||
|
extern pthread_mutex_t KOMODO_CC_mutex;
|
||||||
|
|
||||||
bool RunCCEval(const CC *cond, const CTransaction &tx, unsigned int nIn)
|
bool RunCCEval(const CC *cond, const CTransaction &tx, unsigned int nIn)
|
||||||
{
|
{
|
||||||
EvalRef eval;
|
EvalRef eval;
|
||||||
|
pthread_mutex_lock(&KOMODO_CC_mutex);
|
||||||
bool out = eval->Dispatch(cond, tx, nIn);
|
bool out = eval->Dispatch(cond, tx, nIn);
|
||||||
//fprintf(stderr,"out %d vs %d isValid\n",(int32_t)out,(int32_t)eval->state.IsValid());
|
pthread_mutex_unlock(&KOMODO_CC_mutex);
|
||||||
|
//fprintf(stderr,"out %d vs %d isValid\n",(int32_t)out,(int32_t)eval->state.IsValid());
|
||||||
assert(eval->state.IsValid() == out);
|
assert(eval->state.IsValid() == out);
|
||||||
|
|
||||||
if (eval->state.IsValid()) return true;
|
if (eval->state.IsValid()) return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user