corr unspendable addr for 'S'
This commit is contained in:
@@ -365,14 +365,15 @@ bool SetAssetOrigpubkey(std::vector<uint8_t> &origpubkey,int64_t &price,const CT
|
|||||||
|
|
||||||
bool GetAssetorigaddrs(struct CCcontract_info *cp,char *CCaddr,char *destaddr,const CTransaction& tx)
|
bool GetAssetorigaddrs(struct CCcontract_info *cp,char *CCaddr,char *destaddr,const CTransaction& tx)
|
||||||
{
|
{
|
||||||
uint256 assetid,assetid2; int64_t price,nValue=0; int32_t n; uint8_t funcid; std::vector<uint8_t> origpubkey;
|
uint256 assetid,assetid2; int64_t price,nValue=0; int32_t n; uint8_t funcid;
|
||||||
|
std::vector<uint8_t> origpubkey;
|
||||||
CScript script;
|
CScript script;
|
||||||
uint8_t evalCode;
|
uint8_t evalCode;
|
||||||
|
|
||||||
n = tx.vout.size();
|
n = tx.vout.size();
|
||||||
if( n == 0 || (funcid= DecodeAssetTokenOpRet(tx.vout[n-1].scriptPubKey, evalCode, assetid, assetid2, price, origpubkey)) == 0 )
|
if( n == 0 || (funcid= DecodeAssetTokenOpRet(tx.vout[n-1].scriptPubKey, evalCode, assetid, assetid2, price, origpubkey)) == 0 )
|
||||||
return(false);
|
return(false);
|
||||||
if ( GetCCaddress(cp, CCaddr, pubkey2pk(origpubkey)) != 0 && Getscriptaddress(destaddr, CScript() << origpubkey << OP_CHECKSIG) != 0 )
|
if( GetTokensCCaddress(cp, CCaddr, pubkey2pk(origpubkey)) != 0 && Getscriptaddress(destaddr, CScript() << origpubkey << OP_CHECKSIG) != 0 )
|
||||||
return(true);
|
return(true);
|
||||||
else
|
else
|
||||||
return(false);
|
return(false);
|
||||||
|
|||||||
@@ -334,6 +334,9 @@ bool AssetsValidate(struct CCcontract_info *cpAssets,Eval* eval,const CTransacti
|
|||||||
//'S'.vout.2: vin.2 value to original pubkey [origpubkey]
|
//'S'.vout.2: vin.2 value to original pubkey [origpubkey]
|
||||||
//vout.3: normal output for change (if any)
|
//vout.3: normal output for change (if any)
|
||||||
//'S'.vout.n-1: opreturn [EVAL_ASSETS] ['S'] [assetid] [amount of coin still required] [origpubkey]
|
//'S'.vout.n-1: opreturn [EVAL_ASSETS] ['S'] [assetid] [amount of coin still required] [origpubkey]
|
||||||
|
char dualEvalUnspendableAddr[64];
|
||||||
|
GetTokensCCaddress(cpAssets, dualEvalUnspendableAddr, GetUnspendable(cpAssets, NULL));
|
||||||
|
|
||||||
if( (assetoshis = AssetValidateSellvin(cpAssets, eval, totalunits, tmporigpubkey, tokensCCaddr, origaddr, tx, assetid)) == 0 )
|
if( (assetoshis = AssetValidateSellvin(cpAssets, eval, totalunits, tmporigpubkey, tokensCCaddr, origaddr, tx, assetid)) == 0 )
|
||||||
return(false);
|
return(false);
|
||||||
else if( numvouts < 3 )
|
else if( numvouts < 3 )
|
||||||
@@ -352,7 +355,7 @@ bool AssetsValidate(struct CCcontract_info *cpAssets,Eval* eval,const CTransacti
|
|||||||
return eval->Invalid("normal vout1 for fillask");
|
return eval->Invalid("normal vout1 for fillask");
|
||||||
else if( remaining_price != 0 )
|
else if( remaining_price != 0 )
|
||||||
{
|
{
|
||||||
if ( ConstrainVout(tx.vout[0], 1, (char *)cpAssets->unspendableCCaddr, 0) == 0 )
|
if ( ConstrainVout(tx.vout[0], 1, dualEvalUnspendableAddr /*(char *)cpAssets->unspendableCCaddr*/, 0) == 0 )
|
||||||
return eval->Invalid("mismatched vout0 assets unspendable CCaddr for fill sell");
|
return eval->Invalid("mismatched vout0 assets unspendable CCaddr for fill sell");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user