Delete more CCs #381

This commit is contained in:
Duke
2024-02-10 22:37:22 -05:00
parent c6aa5e939d
commit 958bc486d4
5 changed files with 21 additions and 438 deletions

View File

@@ -84,25 +84,5 @@ UniValue custom_func1(uint64_t txfee,struct CCcontract_info *cp,cJSON *params)
bool custom_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx)
{
char expectedaddress[64]; CPubKey pk;
CScript opret; int32_t numvout = 0;
if ( has_opret(tx, EVAL_CUSTOM) == 0 )
{
std::vector<std::vector<unsigned char>> vParams = std::vector<std::vector<unsigned char>>();
if ( getCCopret(tx.vout[0].scriptPubKey,opret) )
numvout = 1;
}
else
{
opret = tx.vout[1].scriptPubKey;
numvout = 2;
}
if ( tx.vout.size() != numvout ) // make sure the tx only has appropriate outputs
return eval->Invalid("invalid number of vouts");
else if ( custom_opretdecode(pk,opret) != '1' ) // verify opreturn payload
return eval->Invalid("invalid opreturn");
GetCCaddress(cp,expectedaddress,pk);
if ( IsCClibvout(cp,tx,0,expectedaddress) == COIN ) // make sure amount and destination matches
return(true);
else return eval->Invalid("invalid vout0 amount");
return false;
}