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