unspendableCCaddr
This commit is contained in:
@@ -71,21 +71,21 @@ struct CCcontract_info *CCinit(struct CCcontract_info *cp,uint8_t evalcode)
|
||||
switch ( evalcode )
|
||||
{
|
||||
case EVAL_ASSETS:
|
||||
strcpy(cp->CCaddress,AssetsCCaddr);
|
||||
strcpy(cp->unspendableCCaddr,AssetsCCaddr);
|
||||
strcpy(cp->CChexstr,AssetsCChexstr);
|
||||
memcpy(cp->CCpriv,AssetsCCpriv,32);
|
||||
cp->validate = AssetsValidate;
|
||||
cp->ismyvin = IsAssetsInput;
|
||||
break;
|
||||
case EVAL_FAUCET:
|
||||
strcpy(cp->CCaddress,FaucetCCaddr);
|
||||
strcpy(cp->unspendableCCaddr,FaucetCCaddr);
|
||||
strcpy(cp->CChexstr,FaucetCChexstr);
|
||||
memcpy(cp->CCpriv,FaucetCCpriv,32);
|
||||
cp->validate = FaucetValidate;
|
||||
cp->ismyvin = IsFaucetInput;
|
||||
break;
|
||||
case EVAL_REWARDS:
|
||||
strcpy(cp->CCaddress,RewardsCCaddr);
|
||||
strcpy(cp->unspendableCCaddr,RewardsCCaddr);
|
||||
strcpy(cp->CChexstr,RewardsCChexstr);
|
||||
memcpy(cp->CCpriv,RewardsCCpriv,32);
|
||||
cp->validate = RewardsValidate;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
struct CCcontract_info
|
||||
{
|
||||
uint256 prevtxid;
|
||||
char CCaddress[64],CChexstr[72];
|
||||
char unspendableCCaddr[64],CChexstr[72];
|
||||
uint8_t CCpriv[32];
|
||||
bool (*validate)(Eval* eval,struct CCcontract_info *cp,const CTransaction &tx);
|
||||
bool (*ismyvin)(CScript const& scriptSig);
|
||||
|
||||
@@ -254,7 +254,7 @@ bool AssetsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx
|
||||
//'e'.vout.n-1: opreturn [EVAL_ASSETS] ['e'] [assetid] [assetid2] [amount of asset2 required] [origpubkey]
|
||||
if ( remaining_price == 0 )
|
||||
return eval->Invalid("illegal null remaining_price for selloffer");
|
||||
else if ( ConstrainVout(tx.vout[0],1,(char *)AssetsCCaddr,0) == 0 )
|
||||
else if ( ConstrainVout(tx.vout[0],1,(char *)cp->unspendableCCaddr,0) == 0 )
|
||||
return eval->Invalid("mismatched vout0 AssetsCCaddr for selloffer");
|
||||
preventCCvouts = 1;
|
||||
break;
|
||||
@@ -311,7 +311,7 @@ bool AssetsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx
|
||||
{
|
||||
if ( remaining_price < 10000 )
|
||||
return eval->Invalid("dust vout0 to AssetsCCaddr for fill");
|
||||
else if ( ConstrainVout(tx.vout[0],1,(char *)AssetsCCaddr,0) == 0 )
|
||||
else if ( ConstrainVout(tx.vout[0],1,(char *)cp->unspendableCCaddr,0) == 0 )
|
||||
return eval->Invalid("mismatched vout0 AssetsCCaddr for fill");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user