]> Git Repo - VerusCoin.git/commitdiff
Fix ask fill dest
authorjl777 <[email protected]>
Thu, 26 Jul 2018 13:06:43 +0000 (02:06 -1100)
committerjl777 <[email protected]>
Thu, 26 Jul 2018 13:06:43 +0000 (02:06 -1100)
src/cc/CCassetstx.cpp
src/cc/assets.cpp

index ae0a3d593e1dde84238405f7f768e6ea8f56e4ca..49e668526464ff02f9afc0611c960aafdad5a107 100644 (file)
@@ -327,7 +327,7 @@ std::string FillSell(uint64_t txfee,uint256 assetid,uint256 assetid2,uint256 ask
                     CCchange = (inputs - paid_nValue);
                 mtx.vout.push_back(MakeCC1vout(EVAL_ASSETS,orig_assetoshis - received_assetoshis,GetUnspendable(cp,0)));
                 mtx.vout.push_back(MakeCC1vout(EVAL_ASSETS,received_assetoshis,mypk));
-                mtx.vout.push_back(CTxOut(paid_nValue,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG));
+                mtx.vout.push_back(CTxOut(paid_nValue,CScript() << origpubkey << OP_CHECKSIG));
                 if ( CCchange != 0 )
                     mtx.vout.push_back(MakeCC1vout(EVAL_ASSETS,CCchange,mypk));
                 return(FinalizeCCTx(cp,mtx,mypk,txfee,EncodeAssetOpRet(assetid2!=zeroid?'E':'S',assetid,assetid2,remaining_nValue,origpubkey)));
index 54e95c95b187d596107322b54d47d6ef0ef3d216..c13264c1eb36b3aae2a6d6550c275f0d44bffe0a 100644 (file)
@@ -229,6 +229,8 @@ bool AssetsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx
             {
                 if ( ConstrainVout(tx.vout[1],0,0,0) == 0 )
                     return eval->Invalid("vout1 is CC for fillbuy");
+                else if ( ConstrainVout(tx.vout[2],1,CCaddr,0) == 0 )
+                    return eval->Invalid("vout1 is normal for fillbuy");
                 else if ( ValidateBidRemainder(remaining_price,tx.vout[0].nValue,nValue,tx.vout[1].nValue,tx.vout[2].nValue,totalunits) == false )
                     return eval->Invalid("mismatched remainder for fillbuy");
                 else if ( remaining_price != 0 )
@@ -291,6 +293,8 @@ bool AssetsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx
                     return eval->Invalid("mismatched remainder for fill");
                 else if ( ConstrainVout(tx.vout[1],1,0,0) == 0 )
                     return eval->Invalid("normal vout1 for fillask");
+                else if ( ConstrainVout(tx.vout[2],0,origaddr,0) == 0 )
+                    return eval->Invalid("normal vout1 for fillask");
                 else if ( remaining_price != 0 )
                 {
                     if ( ConstrainVout(tx.vout[0],1,(char *)cp->unspendableCCaddr,0) == 0 )
This page took 0.027189 seconds and 4 git commands to generate.