Merge branch 'FSM' into jl777

This commit is contained in:
jl777
2019-06-10 05:18:25 -11:00
7 changed files with 71 additions and 36 deletions

View File

@@ -59,6 +59,8 @@ one other technical note is that komodod has the insight-explorer extensions bui
#define SMALLVAL 0.000000000000001
#define SATOSHIDEN ((uint64_t)100000000L)
#define dstr(x) ((double)(x) / SATOSHIDEN)
#define CCDISABLEALL memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES))
#define CCENABLE(x) ASSETCHAINS_CCDISABLES[((uint8_t)x)] = 0
#ifndef _BITS256
#define _BITS256

View File

@@ -78,8 +78,13 @@ bool Eval::Dispatch(const CC *cond, const CTransaction &txTo, unsigned int nIn)
uint8_t ecode = cond->code[0];
if ( ASSETCHAINS_CCDISABLES[ecode] != 0 )
{
fprintf(stderr,"%s evalcode.%d %02x\n",txTo.GetHash().GetHex().c_str(),ecode,ecode);
return Invalid("disabled-code, -ac_ccenables didnt include this ecode");
// check if a height activation has been set.
if ( mapHeightEvalActivate[ecode] == 0 || this->GetCurrentHeight() == 0 || mapHeightEvalActivate[ecode] > this->GetCurrentHeight() )
{
fprintf(stderr,"%s evalcode.%d %02x\n",txTo.GetHash().GetHex().c_str(),ecode,ecode);
fprintf(stderr, "ac_ccactivateht: evalcode.%i activates at height.%i vs current height.%i\n", ecode, mapHeightEvalActivate[ecode], this->GetCurrentHeight());
return Invalid("disabled-code, -ac_ccenables didnt include this ecode");
}
}
std::vector<uint8_t> vparams(cond->code+1, cond->code+cond->codeLength);
if ( ecode >= EVAL_FIRSTUSER && ecode <= EVAL_LASTUSER )

View File

@@ -642,11 +642,7 @@ int32_t GetLatestTimestamp(int32_t height)
blockHash = chainActive[height]->GetBlockHash();
pindex = mapBlockIndex[blockHash];
if ( komodo_blockload(block,pindex) == 0 )
{
return(block.nTime);
}
return(0);
return(pindex->nTime);
}
bool OraclesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn)
@@ -1208,4 +1204,3 @@ UniValue OraclesList()
}
return(result);
}