From bd5f0103a8bbdd9846629adc33d02b31cfd8dd27 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 22 Sep 2024 12:19:12 -0400 Subject: [PATCH] Remove more cc code --- src/hush_nSPV_fullnode.h | 58 ---------------------------------------- src/rpc/blockchain.cpp | 2 +- 2 files changed, 1 insertion(+), 59 deletions(-) diff --git a/src/hush_nSPV_fullnode.h b/src/hush_nSPV_fullnode.h index 2cf9cc9f5..57a3dd67a 100644 --- a/src/hush_nSPV_fullnode.h +++ b/src/hush_nSPV_fullnode.h @@ -233,64 +233,6 @@ public: DefaultCCChecker() { } virtual bool checkCC(uint256 txid, const std::vector &vouts, int32_t nvout, uint8_t evalcode, std::string funcids, uint256 filtertxid) { - CScript opret, dummy; - std::vector< vscript_t > vParams; - vscript_t vopret; - - if (nvout < vouts.size()) - { - // first check if it is cc vout - if (vouts[nvout].scriptPubKey.IsPayToCryptoCondition(&dummy, vParams)) - { - // try to find cc opret - if (vParams.size() > 0) - { - COptCCParams p(vParams[0]); // parse vout data - if (p.vData.size() > 0) - { - vopret = p.vData[0]; // get opret data - } - } - // if no cc opret check last vout opret - if (vopret.size() == 0) - { - GetOpReturnData(vouts.back().scriptPubKey, vopret); - } - if (vopret.size() > 2) - { - uint8_t opretEvalcode, opretFuncid; - uint256 opretTxid; - bool isEof = true; - bool isCreateTx = false; - - // parse opret first 3 fields: - bool parseOk = E_UNMARSHAL(vopret, - ss >> opretEvalcode; - ss >> opretFuncid; - if (funcids.size() > 0 && opretFuncid == funcids[0]) // this means that we check txid only for second+ funcid in array (considering that the first funcid is the creation txid itself like tokens) - { - isCreateTx = true; - } - else - { - ss >> opretTxid; - isCreateTx = false; - } - isEof = ss.eof(); ); - - opretTxid = revuint256(opretTxid); - std::cerr << __func__ << " " << "opretEvalcode=" << opretEvalcode << " opretFuncid=" << (char)opretFuncid << " isCreateTx=" << isCreateTx << " opretTxid=" << opretTxid.GetHex() << std::endl; - if( parseOk /*parseOk=true if eof reached*/|| !isEof /*more data means okay*/) - { - if (evalcode == opretEvalcode && std::find(funcids.begin(), funcids.end(), (char)opretFuncid) != funcids.end() && - (isCreateTx && filtertxid == txid || !isCreateTx && filtertxid == opretTxid)) - { - return true; - } - } - } - } - } return false; } }; diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index dbd0da9ed..7a26b2b03 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -242,7 +242,7 @@ UniValue blockToDeltasJSON(const CBlock& block, const CBlockIndex* blockindex) vector hashBytes(out.scriptPubKey.begin()+3, out.scriptPubKey.begin()+23); delta.push_back(Pair("address", CBitcoinAddress(CKeyID(uint160(hashBytes))).ToString())); } - else if (out.scriptPubKey.IsPayToPublicKey() || out.scriptPubKey.IsPayToCryptoCondition()) { + else if (out.scriptPubKey.IsPayToPublicKey()) { CTxDestination address; if (ExtractDestination(out.scriptPubKey, address)) {