vopretStripped eliminated in heir cc

This commit is contained in:
dimxy
2019-02-14 23:02:38 +05:00
parent f18a3224c9
commit a37e1ae633

View File

@@ -327,16 +327,17 @@ uint8_t _DecodeHeirEitherOpRet(CScript scriptPubKey, uint256 &tokenid, CPubKey&
{ {
uint8_t evalCodeTokens = 0; uint8_t evalCodeTokens = 0;
std::vector<CPubKey> voutPubkeysDummy; std::vector<CPubKey> voutPubkeysDummy;
std::vector<uint8_t> vopretExtra, vopretStripped; std::vector<uint8_t> vopretExtra /*, vopretStripped*/;
if (DecodeTokenOpRet(scriptPubKey, evalCodeTokens, tokenid, voutPubkeysDummy, vopretExtra) != 0) { if (DecodeTokenOpRet(scriptPubKey, evalCodeTokens, tokenid, voutPubkeysDummy, vopretExtra) != 0) {
if (vopretExtra.size() > 1) { if (vopretExtra.size() > 1) {
// restore the second opret: // 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; if (!noLogging) std::cerr << "_DecodeHeirEitherOpret() could not unmarshal vopretStripped" << std::endl;
return (uint8_t)0; return (uint8_t)0;
} }*/
} }
else { else {
if (!noLogging) std::cerr << "_DecodeHeirEitherOpret() empty vopretExtra" << std::endl; if (!noLogging) std::cerr << "_DecodeHeirEitherOpret() empty vopretExtra" << std::endl;
@@ -344,10 +345,10 @@ uint8_t _DecodeHeirEitherOpRet(CScript scriptPubKey, uint256 &tokenid, CPubKey&
} }
} }
else { 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: // overload to decode opret in fundingtxid: