diff --git a/src/cc/CCassetsCore.cpp b/src/cc/CCassetsCore.cpp index b6b2edb2c..eae6df8bf 100644 --- a/src/cc/CCassetsCore.cpp +++ b/src/cc/CCassetsCore.cpp @@ -296,7 +296,7 @@ bool AssetExactAmounts(Eval* eval,CTransaction &tx,uint256 assetid) numvouts = tx.vout.size(); for (i=1; iGetTxUnconfirmed(tx.vin[i].prevout.hash,vinTx,hashBlock) == 0 ) return eval->Invalid("always should find vin, but didnt"); diff --git a/src/cc/CCcustom.cpp b/src/cc/CCcustom.cpp index ab6daf1ab..8985d7719 100644 --- a/src/cc/CCcustom.cpp +++ b/src/cc/CCcustom.cpp @@ -35,6 +35,24 @@ char AssetsCChexstr[67] = { "02adf84e0e075cf90868bd4e3d34a03420e034719649c41f371 uint8_t AssetsCCpriv[32] = { 0x9b, 0x17, 0x66, 0xe5, 0x82, 0x66, 0xac, 0xb6, 0xba, 0x43, 0x83, 0x74, 0xf7, 0x63, 0x11, 0x3b, 0xf0, 0xf3, 0x50, 0x6f, 0xd9, 0x6b, 0x67, 0x85, 0xf9, 0x7a, 0xf0, 0x54, 0x4d, 0xb1, 0x30, 0x77 }; CC *MakeAssetCond(CPubKey pk); + +bool IsAssetsInput(CScript const& scriptSig) +{ + CC *cond; + if (!(cond = GetCryptoCondition(scriptSig))) + return false; + // Recurse the CC tree to find asset condition + auto findEval = [&] (CC *cond, struct CCVisitor _) { + bool r = cc_typeId(cond) == CC_Eval && cond->codeLength == 1 && cond->code[0] == EVAL_ASSETS; + // false for a match, true for continue + return r ? 0 : 1; + }; + CCVisitor visitor = {findEval, (uint8_t*)"", 0, NULL}; + bool out =! cc_visit(cond, visitor); + cc_free(cond); + return out; +} + CPubKey GetUnspendable(uint8_t evalcode,uint8_t *unspendablepriv) { static CPubKey nullpk; diff --git a/src/cc/CCinclude.h b/src/cc/CCinclude.h index cdab5965d..9533dc994 100644 --- a/src/cc/CCinclude.h +++ b/src/cc/CCinclude.h @@ -43,7 +43,6 @@ bool GetCCaddress(uint8_t evalcode,char *destaddr,CPubKey pk); // CCutils CC* GetCryptoCondition(CScript const& scriptSig); bool IsCCInput(CScript const& scriptSig); -bool IsEvalInput(uint8_t evalcode,CScript const& scriptSig); uint256 revuint256(uint256 txid); char *uint256_str(char *dest,uint256 txid); uint256 Parseuint256(char *hexstr); diff --git a/src/cc/CCutils.cpp b/src/cc/CCutils.cpp index 1eadfd6c3..7ac92a51c 100644 --- a/src/cc/CCutils.cpp +++ b/src/cc/CCutils.cpp @@ -37,23 +37,6 @@ bool IsCCInput(CScript const& scriptSig) return true; } -bool IsEvalInput(uint8_t evalcode,CScript const& scriptSig) -{ - CC *cond; - if (!(cond = GetCryptoCondition(scriptSig))) - return false; - // Recurse the CC tree to find asset condition - auto findEval = [&] (CC *cond, struct CCVisitor _) { - bool r = cc_typeId(cond) == CC_Eval && cond->codeLength == 1 && cond->code[0] == evalcode; - // false for a match, true for continue - return r ? 0 : 1; - }; - CCVisitor visitor = {findEval, (uint8_t*)"", 0, NULL}; - bool out =! cc_visit(cond, visitor); - cc_free(cond); - return out; -} - uint256 revuint256(uint256 txid) { uint256 revtxid; int32_t i; diff --git a/src/cc/assets copy.cpp b/src/cc/assets copy.cpp index e34bee39d..f823b5a1a 100644 --- a/src/cc/assets copy.cpp +++ b/src/cc/assets copy.cpp @@ -997,7 +997,7 @@ bool AssetExactAmounts(Eval* eval,CTransaction &tx,uint256 assetid) numvouts = tx.vout.size(); for (i=1; iGetTxUnconfirmed(tx.vin[i].prevout.hash,vinTx,hashBlock) == 0 ) return eval->Invalid("always should find vin, but didnt");