HUSHCC
This commit is contained in:
@@ -826,7 +826,7 @@ bool ProcessCC(struct CCcontract_info *cp,Eval* eval, std::vector<uint8_t> param
|
||||
height = HUSH_CONNECTING;
|
||||
if ( HUSH_CONNECTING < 0 ) // always comes back with > 0 for final confirmation
|
||||
return(true);
|
||||
if ( ASSETCHAINS_CC == 0 || (height & ~(1<<30)) < KOMODO_CCACTIVATE )
|
||||
if ( ASSETCHAINS_CC == 0 || (height & ~(1<<30)) < HUSH_CCACTIVATE )
|
||||
return eval->Invalid("CC are disabled or not active yet");
|
||||
if ( (HUSH_CONNECTING & (1<<30)) != 0 )
|
||||
{
|
||||
@@ -836,7 +836,7 @@ bool ProcessCC(struct CCcontract_info *cp,Eval* eval, std::vector<uint8_t> param
|
||||
if (cp->validate == NULL)
|
||||
return eval->Invalid("validation not supported for eval code");
|
||||
|
||||
//fprintf(stderr,"HUSH_CONNECTING.%d mempool.%d vs CCactive.%d\n",height,from_mempool,KOMODO_CCACTIVATE);
|
||||
//fprintf(stderr,"HUSH_CONNECTING.%d mempool.%d vs CCactive.%d\n",height,from_mempool,HUSH_CCACTIVATE);
|
||||
// there is a chance CC tx is valid in mempool, but invalid when in block, so we cant filter duplicate requests. if any of the vins are spent, for example
|
||||
//txid = ctx.GetHash();
|
||||
//if ( txid == cp->prevtxid )
|
||||
@@ -872,7 +872,7 @@ bool CClib_Dispatch(const CC *cond,Eval *eval,std::vector<uint8_t> paramsNull,co
|
||||
height = HUSH_CONNECTING;
|
||||
if ( HUSH_CONNECTING < 0 ) // always comes back with > 0 for final confirmation
|
||||
return(true);
|
||||
if ( ASSETCHAINS_CC == 0 || (height & ~(1<<30)) < KOMODO_CCACTIVATE )
|
||||
if ( ASSETCHAINS_CC == 0 || (height & ~(1<<30)) < HUSH_CCACTIVATE )
|
||||
return eval->Invalid("CC are disabled or not active yet");
|
||||
if ( (HUSH_CONNECTING & (1<<30)) != 0 )
|
||||
{
|
||||
|
||||
@@ -33,14 +33,14 @@ char *CClib_name();
|
||||
|
||||
Eval* EVAL_TEST = 0;
|
||||
struct CCcontract_info CCinfos[0x100];
|
||||
extern pthread_mutex_t KOMODO_CC_mutex;
|
||||
extern pthread_mutex_t HUSH_CC_mutex;
|
||||
|
||||
bool RunCCEval(const CC *cond, const CTransaction &tx, unsigned int nIn)
|
||||
{
|
||||
EvalRef eval;
|
||||
pthread_mutex_lock(&KOMODO_CC_mutex);
|
||||
pthread_mutex_lock(&HUSH_CC_mutex);
|
||||
bool out = eval->Dispatch(cond, tx, nIn);
|
||||
pthread_mutex_unlock(&KOMODO_CC_mutex);
|
||||
pthread_mutex_unlock(&HUSH_CC_mutex);
|
||||
if ( eval->state.IsValid() != out)
|
||||
fprintf(stderr,"out %d vs %d isValid\n",(int32_t)out,(int32_t)eval->state.IsValid());
|
||||
//assert(eval->state.IsValid() == out);
|
||||
|
||||
Reference in New Issue
Block a user