From f0f091ba0a5e73bcea28737cd05ffe3b2c9b48ee Mon Sep 17 00:00:00 2001 From: dimxy Date: Fri, 19 Apr 2019 02:31:07 +0500 Subject: [PATCH] lev deser restored --- src/cc/prices.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/cc/prices.cpp b/src/cc/prices.cpp index 31e316c6d..42559fd9d 100644 --- a/src/cc/prices.cpp +++ b/src/cc/prices.cpp @@ -60,21 +60,16 @@ CScript prices_betopret(CPubKey mypk,int32_t height,int64_t amount,int16_t lever { CScript opret; opret << OP_RETURN << E_MARSHAL(ss << EVAL_PRICES << 'B' << mypk << height << amount << leverage << firstprice << vec << tokenid); - std::cerr << "prices_betopret() leverage=" << leverage << std::endl; return(opret); } uint8_t prices_betopretdecode(CScript scriptPubKey,CPubKey &pk,int32_t &height,int64_t &amount,int16_t &leverage,int64_t &firstprice,std::vector &vec,uint256 &tokenid) { std::vector vopret; uint8_t e,f; - unsigned char u, l; + GetOpReturnData(scriptPubKey,vopret); - if (vopret.size() > 2 && E_UNMARSHAL(vopret, ss >> e; ss >> f; ss >> pk; ss >> height; ss >> amount; ss >> l; ss >> u; ss >> firstprice; ss >> vec; ss >> tokenid) != 0 && e == EVAL_PRICES && f == 'B') + if (vopret.size() > 2 && E_UNMARSHAL(vopret, ss >> e; ss >> f; ss >> pk; ss >> height; ss >> amount; ss >> leverage; ss >> firstprice; ss >> vec; ss >> tokenid) != 0 && e == EVAL_PRICES && f == 'B') { - unsigned char *p = (unsigned char*)&leverage; - *p = l; - *(p + 1) = u; - std::cerr << "prices_betopretdecode() leverage=" << leverage << std::endl; return(f); } return(0);