From d41cd8b99178036aeca822a3bd2cfe143b94a593 Mon Sep 17 00:00:00 2001 From: dimxy Date: Sun, 13 Jan 2019 23:07:31 +0500 Subject: [PATCH] corr unmarshal retcode proc in _DecodeHeirEitherOpRet GetTokenBalance returns error always, obsolete --- src/cc/CCtokens.cpp | 7 +++++-- src/cc/heir.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cc/CCtokens.cpp b/src/cc/CCtokens.cpp index c759f3704..70aa60d92 100644 --- a/src/cc/CCtokens.cpp +++ b/src/cc/CCtokens.cpp @@ -661,7 +661,10 @@ int64_t GetTokenBalance(CPubKey pk, uint256 tokenid) CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight()); CTransaction tokentx; - if (GetTransaction(tokenid, tokentx, hashBlock, false) == 0) + CCerror = strprintf("obsolete, cannot return correct value without eval"); + return 0; + +/* if (GetTransaction(tokenid, tokentx, hashBlock, false) == 0) { fprintf(stderr, "cant find tokenid\n"); CCerror = strprintf("cant find tokenid"); @@ -670,7 +673,7 @@ int64_t GetTokenBalance(CPubKey pk, uint256 tokenid) struct CCcontract_info *cp, C; cp = CCinit(&C, EVAL_TOKENS); - return(AddTokenCCInputs(cp, mtx, pk, tokenid, 0, 0)); + return(AddTokenCCInputs(cp, mtx, pk, tokenid, 0, 0)); */ } UniValue TokenInfo(uint256 tokenid) diff --git a/src/cc/heir.cpp b/src/cc/heir.cpp index b0272542c..1d74b4970 100644 --- a/src/cc/heir.cpp +++ b/src/cc/heir.cpp @@ -423,7 +423,7 @@ uint8_t _DecodeHeirEitherOpret(CScript scriptPubKey, uint256 &tokenid, CPubKey& // restore the second opret: heirScript = CScript(); - if (E_UNMARSHAL(vopretExtra, { ss >> vopretStripped; })) { //strip string size + if (!E_UNMARSHAL(vopretExtra, { ss >> vopretStripped; })) { //strip string size if (!noLogging) std::cerr << "_DecodeHeirEitherOpret() could not unmarshal vopretStripped" << std::endl; return (uint8_t)0; }