From a25af8d781ecb891b6fb145cd4cc3b0773b3d605 Mon Sep 17 00:00:00 2001 From: dim71 Date: Sat, 1 Dec 2018 03:28:07 +0500 Subject: [PATCH] removed unused commented function --- src/cc/assets.cpp | 56 ----------------------------------------------- 1 file changed, 56 deletions(-) diff --git a/src/cc/assets.cpp b/src/cc/assets.cpp index 92c1ddaac..378c427a9 100644 --- a/src/cc/assets.cpp +++ b/src/cc/assets.cpp @@ -131,60 +131,6 @@ -// Recursively browses and verifies tx's vins to make sure no fake tokens have been 'planted' -// This func should be call with maxlevels = 2 -// on the first level it validates that current tx does not have invalid non-cc inputs -// on the second level it validates that all cc inputs of this tx also don't have 'feeding' non-cc inputs -/* -bool ValidateInputsTraversal(int32_t maxlevels, struct CCcontract_info *cp, Eval* eval, const CTransaction &tx, uint256 assetid) -{ - int64_t dummyPrice; - std::vector dummyPubkey; - uint256 dummyAsset, dummyAsset2; - - int32_t numvins = tx.vin.size(); - int32_t numvouts = tx.vout.size(); - - // check it for the sake of.. - if (numvouts == 0) - return false; - - uint8_t funcId = DecodeAssetOpRet(tx.vout[numvouts - 1].scriptPubKey, dummyAsset, dummyAsset2, dummyPrice, dummyPubkey); - - // this is initial tokenbase tx: - if (tx.GetHash() == assetid && funcId == 'c') { - std::cerr << "ValidateInputsTraversal() found initial tx=" << assetid.GetHex() << std::endl; - return true; - } - - int64_t myCCVinsAmount = 0; - int64_t myCCVoutsAmount = 0; - std::vector ccVinsTxs; - - bool isCCEqual = AssetExactAmounts(cp, myCCVinsAmount, 0, myCCVoutsAmount, eval, tx, assetid); - if (!isCCEqual) { //Note: for the spending tx (1-st level) this condition is also checked in AssetsValidate() itself -- dimxy - std::cerr << "ValidateInputsTraversal() found bad uxto txid=" << tx.GetHash().GetHex() << " ccVinsAmount=" << myCCVinsAmount << " ccVoutsAmount=" << myCCVoutsAmount << std::endl; - eval->Invalid("deep search found bad non-cc uxto"); - return false; - } - - // recursively validate vins' txs (only for one level - see maxlevels var): - bool allVinTxsGood = true; - - if (--maxlevels > 0) { - for (int32_t i = 0; i < ccVinsTxs.size(); i++) { - if (!ValidateInputsTraversal(maxlevels, cp, eval, ccVinsTxs[i], assetid)) { - allVinTxsGood = false; - break; - } - } - } - - std::cerr << "ValidateInputsTraversal() for txid=" << tx.GetHash().GetHex() << " allVinTxsGood=" << std::boolalpha << allVinTxsGood << std::endl; - - return allVinTxsGood; -} -*/ // tx validation bool AssetsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn) @@ -217,8 +163,6 @@ bool AssetsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx return eval->Invalid("asset inputs != outputs"); } -// if( !ValidateInputsTraversal(2, cp, eval, tx, assetid) ) -// return false; switch ( funcid ) {