From a37e1ae63363c64f1503e9a7c9c306666d3b432c Mon Sep 17 00:00:00 2001 From: dimxy Date: Thu, 14 Feb 2019 23:02:38 +0500 Subject: [PATCH 1/2] vopretStripped eliminated in heir cc --- src/cc/heir.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cc/heir.cpp b/src/cc/heir.cpp index 4fea0be1e..d90f87d07 100644 --- a/src/cc/heir.cpp +++ b/src/cc/heir.cpp @@ -327,16 +327,17 @@ uint8_t _DecodeHeirEitherOpRet(CScript scriptPubKey, uint256 &tokenid, CPubKey& { uint8_t evalCodeTokens = 0; std::vector voutPubkeysDummy; - std::vector vopretExtra, vopretStripped; + std::vector vopretExtra /*, vopretStripped*/; if (DecodeTokenOpRet(scriptPubKey, evalCodeTokens, tokenid, voutPubkeysDummy, vopretExtra) != 0) { if (vopretExtra.size() > 1) { // restore the second opret: - if (!E_UNMARSHAL(vopretExtra, { ss >> vopretStripped; })) { //strip string size + /* unmarshalled in DecodeTokenOpRet: + if (!E_UNMARSHAL(vopretExtra, { ss >> vopretStripped; })) { //strip string size if (!noLogging) std::cerr << "_DecodeHeirEitherOpret() could not unmarshal vopretStripped" << std::endl; return (uint8_t)0; - } + }*/ } else { if (!noLogging) std::cerr << "_DecodeHeirEitherOpret() empty vopretExtra" << std::endl; @@ -344,10 +345,10 @@ uint8_t _DecodeHeirEitherOpRet(CScript scriptPubKey, uint256 &tokenid, CPubKey& } } else { - GetOpReturnData(scriptPubKey, vopretStripped); + GetOpReturnData(scriptPubKey, vopretExtra); } - return _DecodeHeirOpRet(vopretStripped, ownerPubkey, heirPubkey, inactivityTime, heirName, memo, fundingTxidInOpret, hasHeirSpendingBegun, noLogging); + return _DecodeHeirOpRet(vopretExtra, ownerPubkey, heirPubkey, inactivityTime, heirName, memo, fundingTxidInOpret, hasHeirSpendingBegun, noLogging); } // overload to decode opret in fundingtxid: From dc739bc9daac0bff64c829adbe3de87018676f00 Mon Sep 17 00:00:00 2001 From: dimxy Date: Thu, 14 Feb 2019 23:33:34 +0500 Subject: [PATCH 2/2] empty if{} removed --- src/cc/heir.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cc/heir.cpp b/src/cc/heir.cpp index d90f87d07..aca30208b 100644 --- a/src/cc/heir.cpp +++ b/src/cc/heir.cpp @@ -330,16 +330,16 @@ uint8_t _DecodeHeirEitherOpRet(CScript scriptPubKey, uint256 &tokenid, CPubKey& std::vector vopretExtra /*, vopretStripped*/; if (DecodeTokenOpRet(scriptPubKey, evalCodeTokens, tokenid, voutPubkeysDummy, vopretExtra) != 0) { - if (vopretExtra.size() > 1) { - // restore the second opret: + /* if (vopretExtra.size() > 1) { + // restore the second opret: - /* unmarshalled in DecodeTokenOpRet: + /* unmarshalled in DecodeTokenOpRet: if (!E_UNMARSHAL(vopretExtra, { ss >> vopretStripped; })) { //strip string size - if (!noLogging) std::cerr << "_DecodeHeirEitherOpret() could not unmarshal vopretStripped" << std::endl; - return (uint8_t)0; - }*/ - } - else { + if (!noLogging) std::cerr << "_DecodeHeirEitherOpret() could not unmarshal vopretStripped" << std::endl; + return (uint8_t)0; + } + } */ + if (vopretExtra.size() < 1) { if (!noLogging) std::cerr << "_DecodeHeirEitherOpret() empty vopretExtra" << std::endl; return (uint8_t)0; }