This commit is contained in:
jl777
2019-01-19 22:52:13 -11:00
parent df2c10a6d7
commit 0b911c18ac

View File

@@ -636,6 +636,8 @@ bool ProcessCC(struct CC_info *cp,Eval* eval, std::vector<uint8_t> paramsNull,co
return(false); return(false);
} }
extern struct CC_info CCinfos[0x100];
bool CClib_Dispatch(const CC *cond,Eval *eval,std::vector<uint8_t> paramsNull,const CTransaction &txTo,unsigned int nIn) bool CClib_Dispatch(const CC *cond,Eval *eval,std::vector<uint8_t> paramsNull,const CTransaction &txTo,unsigned int nIn)
{ {
uint8_t evalcode; int32_t height,from_mempool; struct CC_info *cp; uint8_t evalcode; int32_t height,from_mempool; struct CC_info *cp;
@@ -657,17 +659,17 @@ bool CClib_Dispatch(const CC *cond,Eval *eval,std::vector<uint8_t> paramsNull,co
evalcode = cond->code[0]; evalcode = cond->code[0];
if ( evalcode >= EVAL_FIRSTUSER && evalcode <= EVAL_LASTUSER ) if ( evalcode >= EVAL_FIRSTUSER && evalcode <= EVAL_LASTUSER )
{ {
cp = &CCinfos[(int32_t)ecode]; cp = &CCinfos[(int32_t)evalcode];
if ( cp->didinit == 0 ) if ( cp->didinit == 0 )
{ {
if ( CClib_initcp(cp,ecode) == 0 ) if ( CClib_initcp(cp,evalcode) == 0 )
cp->didinit = 1; cp->didinit = 1;
else return eval->Invalid("unsupported CClib evalcode"); else return eval->Invalid("unsupported CClib evalcode");
} }
CCclearvars(cp); CCclearvars(cp);
if ( paramsNull.size() != 0 ) // Don't expect params if ( paramsNull.size() != 0 ) // Don't expect params
return eval->Invalid("Cannot have params"); return eval->Invalid("Cannot have params");
else if ( CClib_validate(cp,eval,ctx,nIn) != 0 ) else if ( CClib_validate(cp,eval,txTo,nIn) != 0 )
return(true); return(true);
return eval->Invalid("error in CClib_validate"); return eval->Invalid("error in CClib_validate");
} }